Skip to content

Commit 782e00c

Browse files
authored
fix: allow mount animation alongside keyboard during initial open (#2661) (#2665)(by @huextrat)
The #2655 guard skipped any RUNNING animation before didAnimateOnMount, which includes keyboard repositioning when TextInput autoFocus opens the keyboard immediately. Only skip mount when a close is in progress (isForcedClosing or nextIndex === -1).
1 parent bc94d54 commit 782e00c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/components/bottomSheet/BottomSheet.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,15 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
967967
*/
968968
if (!didAnimateOnMount.value) {
969969
/**
970-
* if there's a running animation (like force close), respect it and don't
971-
* override with mount animation
970+
* If a *close* animation is already running, do not override it with the mount
971+
* animation (#2655). Keyboard-driven animations can also be RUNNING during this
972+
* phase (e.g. TextInput autoFocus); those must not block mount or the sheet stays
973+
* misaligned with the keyboard (#2661).
972974
*/
973-
if (animationStatus === ANIMATION_STATUS.RUNNING) {
975+
if (
976+
animationStatus === ANIMATION_STATUS.RUNNING &&
977+
(isForcedClosing || nextIndex === -1)
978+
) {
974979
return;
975980
}
976981
/**

0 commit comments

Comments
 (0)