Open 7dp opened 5 months ago
Sorry for the blurry video, hope the problem still be visible.
Hey @7dp
Yeah, this is currently a limitation of KeyboardToolbar
- it detects all inputs on the screen.
F full solution would be exporting component like KeyboardToolbar.Exclude
and wrap TextInputs
which you wouldn't like to be detectable, or KeyboardToolbar.SequentialForm
to show a region in which TextInputs
should be scanned.
Right now I see two potential solutions:
BottomSheetModal
instead of BottomSheet
- in this case TextInput
shouldn't exist in hierarchy unless Modal is actually visible.KeyboardToolbar
:
onFocus
/onBlur
to last TextInput
and modify a state based on the event (isLastInputFocused
);KeyboardToolbar
you'll need to override Button
component (https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-toolbar#button) - it has disabled
property that you'll need to modify and use like disabled || isLastInputFocused
. Though it may be hard to achieve, because I'm not exporting Button
and Icon
components 🙈 Anyway, let me know if any of these workaround is actually fixes the problem for you or not 👀
Thanks for the suggested workarounds, Kirill.
For now i'll just disable the KeyboardToolbar
component.
Thanks for the suggested workarounds, Kirill.
As an option 😁
I'll keep the issue open - when I have more spare cycles I'll get back to this issue and will create a proper solution 👍
Hi 🙌. Thank you so much for your hard work on this amazing lib. Truly useful for the community. ❤️
Describe the bug So i have a screen in my RN app. The screen has a several
TextInput
inside aKeyboardAwareScrollView
(KAS is from this lib). And i have aBottomSheet
(from Gorhom) that has aBottomSheetTextInput
inside it. Lastly, i have aKeyboardToolbar
. The problem begin when i focused to the lastTextInput
inside KAS and then i click the next button ofKeyboardToolbar
and then suddenly myBottomSheet
(that i haven't opened yet before) is appear with theBottomSheetTextInput
is focused.Code snippet
Repo for reproducing https://github.com/7dp/KeyboardToolbarBottomSheetRepro
To Reproduce Steps to reproduce the behavior:
TextInput
inside KAS.KeyboardToolbar
.BottomSheet
will suddenly appear with a focusedBottomSheetTextInput
.Expected behavior
KeyboardToolbar
next/prev click should not focus to theBottomSheetTextInput
inside theBottomSheet
, so theBottomSheet
will not appear at all.Screenshots Record: https://github.com/kirillzyusko/react-native-keyboard-controller/assets/49138064/fda545a1-3ba3-4594-9400-d033b0e1c4d4
Smartphone (please complete the following information):