Skip to content

Commit 204f138

Browse files
committed
fix draw under status bar with keyboad opened
1 parent 1036f93 commit 204f138

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,21 +346,23 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
346346
? dimensionsRef.current.height -
347347
(keyboard.keyboardHeight + safeAreaPaddings.current.bottom)
348348
: dimensionsRef.current.height - safeAreaPaddings.current.bottom;
349-
const correctedOffset = keyboard.keyboardShown
350-
? value.value - keyboard.keyboardHeight
351-
: value.value;
352349

353-
if (actionSheetHeight.current > correctedHeight - 1) {
354-
if (correctedOffset < 100) {
350+
if (actionSheetHeight.current >= correctedHeight - 1) {
351+
if (value.value < 100) {
355352
animations.underlayTranslateY.setValue(
356-
Math.max(correctedOffset - 20, -20),
353+
Math.max(value.value - 20, -20),
357354
);
358355
} else {
359356
//@ts-ignore
360-
if (animations.underlayTranslateY._value < 100) {
357+
if (animations.underlayTranslateY._value !== 100) {
361358
animations.underlayTranslateY.setValue(100);
362359
}
363360
}
361+
} else {
362+
//@ts-ignore
363+
if (animations.underlayTranslateY._value !== 100) {
364+
animations.underlayTranslateY.setValue(100);
365+
}
364366
}
365367
}
366368
});

0 commit comments

Comments
 (0)