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

Close Keyboard in sync with dismissing BottomSheet #82

Closed
izakfilmalter opened this issue Nov 22, 2020 · 2 comments · Fixed by #91
Closed

Close Keyboard in sync with dismissing BottomSheet #82

izakfilmalter opened this issue Nov 22, 2020 · 2 comments · Fixed by #91
Assignees
Labels
enhancement New feature or request

Comments

@izakfilmalter
Copy link

Feature Request

Wondering if there is a way to close the keyboard in sync with the BottomSheet being dismissed via drag. I have it working nicely when you press the close button:

  const handleDismissPress = useCallback(() => {
    Keyboard.dismiss()
    dismiss()
  }, [dismiss])

Why it is needed

Seems janky to watch the BottomSheet dismiss fully and then watch the keyboard dismiss.

Possible implementation

I poked around for a couple min to see if I could do this easily on a ListView in the lib. Should be possible.

@izakfilmalter izakfilmalter added the enhancement New feature or request label Nov 22, 2020
@gorhom
Copy link
Owner

gorhom commented Nov 24, 2020

hi @izakfilmalter,

good suggestion, i would think of a callback whenever the sheet about to animate to a snap point, that would give the user more control. it would be something like onSnapToPoint or onAnimate:

type onAnimate = (fromIndex: number, toIndex: number) => void

@izakfilmalter
Copy link
Author

Ya that would be super helpful. I think you can can also do animations in the sheet then based on where it is snapped.

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

Successfully merging a pull request may close this issue.

2 participants