-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
[v4] animatedKeyboardHeightInContainer is 0 when Keyboard is open #1119
Comments
thank god. I thought this issue was related to my very application but it seems to be a known problem. what I noticed for my app: I have a couple of input fields in the bottom sheet and previously set the auto-focus to the first input field. since I continuously had problems with this approach, I removed that and instead manually set the focus 500ms after the bottom sheet was rendered. this improves the situation quite a bit but obviously is a hack. What makes things a bit more cumbersome: in same cases, I'm accessing the clipboard of the user and iOS asks the user if he wants to allow my app to access the clipboard. In this situation, the UI is already rendered but the OS dialog opens with the question if the clipboard can be access or not. if I now press yes and render the input of the clipboard in the bottom sheet, the height oft the content increases which causes the keyboard to overlap the bottom sheet because it apparently no longer reacts to the increased content height. (it does notice the height change however since the onlayout event is triggered and you can see that the height is increasing). |
Reproducible sample code
|
With autofocus it is just hiding behind the keyboard: Without autofocus: you'll see an expand button that will increase the height of the blue area at the bottom. I didn't fully understand under which circumstances it actually rearranges the bottom sheet but you can clearly see how sometimes it just doesn't adjust the position at all. It's also odd that the view doesn't move down again, when I close the keyboard Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2022-10-01.at.16.05.24.mp4I'm basically looking for a way to have a box with custom and partially dynamic height at the bottom of my screen which moves upwards if the keyboard is open |
this will be fixed with |
Is there an eta on v5 release date? |
* chore: updated dependencies * refactor: updated ReText view for web * chore: added cursor for handle container * chore: updated expo version for example project * feat: added scrollable component for web * feat: added gesture and scroll handler for web * chore: added getRefNativeTag for web * feat: rewrite gesture apis with gesture handler 2 (#1126) * chore: updated dependencies * feat: rewrite the gesture api with gh2 * fix(#1119): fixed race condition between onmount and keyboard animations * fix: update ref handler for web * chore: removed unused component * chore: updated expo * fix: detached example on web
Still experiencing this issue. Publishing it as a pre-release tagged |
* chore: updated dependencies * feat: rewrite the gesture api with gh2 gorhom@6a4d296 fix(gorhom#1119): fixed race condition between onmount and keyboard animations
Bug
In some random cases, BottomSheetModal doesn't open correctly when it contains a text field. In such buggy cases
animatedKeyboardHeightInContainer.value
is rewriting to 0 after a keyboard was opened, because of true for!isAnimatedOnMount.value
condition insrc/components/bottomSheet/BottomSheet.tsx
:Note: bug is reproduced for any value of
keyboardBehavior
Logs
Video
bottomsheet_bug.mp4
Environment info
Steps To Reproduce
BottomSheetModal
which contains a text field by tapping onPresent Modal
button.BottomSheetModal
by clicking ondone
keyboard button and repeat point 1.Describe what you expected to happen:
The
BottomSheetModal
with a text field inside is opened according to thekeyboardBehavior
parameter every time thepresent
method of the modal is called.Reproducible sample code
The text was updated successfully, but these errors were encountered: