[MOO-2480] resolve keyboard covering inputs in iOS modal bottom sheet - #634
[MOO-2480] resolve keyboard covering inputs in iOS modal bottom sheet#634stelselim wants to merge 3 commits into
Conversation
| * these take effect at all. | ||
| */ | ||
| const keyboardProps: Pick<GorhomBottomSheetProps, "keyboardBehavior" | "keyboardBlurBehavior"> = | ||
| Platform.OS === "ios" ? { keyboardBehavior: "interactive", keyboardBlurBehavior: "restore" } : {}; |
There was a problem hiding this comment.
Does restore fight with our own close()? If the keyboard hides mid-close, getEvaluatedPosition returns detents[currentIndex] and currentIndex is still 0, so it re-opens. And the index never changes, so no onChange/onClose, nothing retries. Worth trying: dismiss keyboard, tap backdrop right after.
| return; | ||
| } | ||
|
|
||
| const subscription = Keyboard.addListener("keyboardWillShow", () => { |
There was a problem hiding this comment.
What if the keyboard is already open when the sheet mounts? No keyboardWillShow, so no target, so we're back to the original bug. Happens with on-change flow that set the trigger while a field is focused. Keyboard.isVisible() on mount?
|
Looks like Expanding drawer has the same problem. |
| backgroundStyle={props.styles.container} | ||
| handleComponent={null} | ||
| handleStyle={{ display: "none" }} | ||
| {...keyboardProps} |
There was a problem hiding this comment.
keyboardBehavior: "interactive" clamps the shift at 0, so once the sheet is near the 90% maxDynamicContentSize cap it can't move up enough. And we don't scroll the input into view. Long form with a field at the bottom is probably still broken.
No description provided.