Skip to content

Commit

Permalink
fix: fix missing keboard height of Safe Keyboard on vivo (#5886)
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming authored Sep 21, 2024
1 parent dfc9e5c commit b67d027
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/composite/Dialog/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const useDialogFooterProps = (props: IDialogFooterProps) => {
};
};

const DEFAULT_KEYBOARD_HEIGHT = 330;
const useSafeKeyboardAnimationStyle = () => {
const { bottom } = useSafeAreaInsets();
const keyboardHeightValue = useSharedValue(0);
Expand All @@ -111,7 +112,8 @@ const useSafeKeyboardAnimationStyle = () => {

useKeyboardEvent({
keyboardWillShow: (e) => {
const keyboardHeight = e.endCoordinates.height;
const height = e.endCoordinates.height;
const keyboardHeight = height < 0 ? DEFAULT_KEYBOARD_HEIGHT : height;
keyboardHeightValue.value = keyboardHeight - bottom;
},
keyboardWillHide: () => {
Expand Down

0 comments on commit b67d027

Please sign in to comment.