lodev09 / react-native-true-sheet

The true native bottom sheet experience 💩
https://sheet.lodev09.com
MIT License
394 stars 12 forks source link

keyboard reappear, input refocus after dismissing the bottom sheet. option to disable this behavior #62

Closed bryanltobing closed 2 months ago

bryanltobing commented 2 months ago

sometimes, it is expected that the keyboard and input fields refocus after the bottom sheet is dismissed. however, I also have a use case where I don't want that.

for example, when dismissing the bottom sheet and then navigating to another screen, I don't want the keyboard and input to reappear and refocus like this.

https://github.com/lodev09/react-native-true-sheet/assets/46083126/296e0e91-b1db-4f4d-ad91-e787febf00c2

In Gorhom Bottom Sheet, I need to handle all this manually by calling Keyboard.dismiss(). so, I'm glad this library handles it automatically. I tried using Keyboard.dismiss() in TrueSheet before presenting it, but it doesn't do anything.

it would be nice to have the option to opt in or opt out of this behavior.

lodev09 commented 2 months ago

I think this is normal behavior since the input is still in focus when you presented the sheet. Did you try blurring the input instead?

input.current?.blur()