Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PickerAvoidingView and PickerStateProvider for better iOS modal handling #11

Closed
wants to merge 4 commits into from

Conversation

cubuspl42
Copy link

This PR introduces two new components, PickerAvoidingView and PickerStateProvider. These components aim to improve the user experience on iOS by ensuring that the picker is not obstructed by its own modal. The PickerAvoidingView handles proper positioning of the picker, while the PickerStateProvider manages the state and interactions between multiple pickers. This update enhances the overall usability of the picker component on iOS devices.

Note: This PR is stacked on top of lawnstarter#496, so that one needs to be merged first

Christoph Pader and others added 4 commits April 13, 2023 22:02
...which provide tools for ensuring that a picker is not covered by its
own modal on iOS.
...to give a more visually pleasant effect.
Comment on lines +253 to +257
setTimeout(() => {
this.props.scrollViewRef.current.scrollTo({
y: textInputBottomY - modalY + 10 + this.props.scrollViewContentOffsetY,
});
}, IOS_MODAL_ANIMATION_DURATION_MS + 50);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we figure out a way of avoiding the setTimeout? Possible via a hook?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was filed by mistake. It was meant for the upstream. I fixed that. Upstream PR: lawnstarter#507

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's continue this thread here

@cubuspl42
Copy link
Author

PR filed by mistake, was meant for the upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants