diff --git a/src/components/bottomSheet/BottomSheet.tsx b/src/components/bottomSheet/BottomSheet.tsx index b3b97f33a..6ff8ed033 100644 --- a/src/components/bottomSheet/BottomSheet.tsx +++ b/src/components/bottomSheet/BottomSheet.tsx @@ -1333,8 +1333,15 @@ const BottomSheetComponent = forwardRef( * @alias OnKeyboardStateChange */ useAnimatedReaction( - () => animatedKeyboardState.value, - (_keyboardState, _previousKeyboardState) => { + () => ({ + _keyboardState: animatedKeyboardState.value, + _keyboardHeight: animatedKeyboardHeight.value, + }), + (result, _previousResult) => { + const { _keyboardState, _keyboardHeight } = result; + const _previousKeyboardState = _previousResult?._keyboardState; + const _previousKeyboardHeight = _previousResult?._keyboardHeight; + const hasActiveGesture = animatedContentGestureState.value === State.ACTIVE || animatedContentGestureState.value === State.BEGAN || @@ -1345,7 +1352,8 @@ const BottomSheetComponent = forwardRef( /** * if keyboard state is equal to the previous state, then exit the method */ - _keyboardState === _previousKeyboardState || + (_keyboardState === _previousKeyboardState && + _keyboardHeight === _previousKeyboardHeight) || /** * if user is interacting with sheet, then exit the method */ @@ -1374,6 +1382,7 @@ const BottomSheetComponent = forwardRef( method: 'useAnimatedReaction::OnKeyboardStateChange', params: { keyboardState: _keyboardState, + keyboardHeight: _keyboardHeight, }, });