Skip to content

Commit

Permalink
[RNMobile][iOS] Fix for toolbar when hiding keybord with cmd + k (ext…
Browse files Browse the repository at this point in the history
…ernal one) #25955
  • Loading branch information
dratwas authored Oct 8, 2020
1 parent 20aa0af commit 8be738a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@ export const KeyboardAvoidingView = ( {
}

function onKeyboardWillHide( { duration, startCoordinates } ) {
// The startCoordinates.height is set to wrong value when we use cmd + k for hide the keyboard (Have no idea why).
// Because of that the `setIsKeyboardOpened` is not invoked and the state of keyboard is wrong.
// The keyboardIsOpenBreakpoint use 100 as a fallback if the startCoordinates.height is too small (cmd + k case)
const keyboardIsOpenBreakpoint =
startCoordinates.height > 100 ? startCoordinates.height / 3 : 100;
const animatedListenerId = animatedHeight.addListener(
( { value } ) => {
if ( value < startCoordinates.height / 3 ) {
if ( value < keyboardIsOpenBreakpoint ) {
setIsKeyboardOpen( false );
}
}
Expand Down

0 comments on commit 8be738a

Please sign in to comment.