@@ -593,6 +593,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
593593 return animatedPosition . value ;
594594 }
595595
596+ if ( ! isAnimatedOnMount . value ) {
597+ return snapPoints [ _providedIndex ] ;
598+ }
599+
596600 return snapPoints [ currentIndex ] ;
597601 } ,
598602 [
@@ -605,8 +609,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
605609 animatedPosition ,
606610 animatedSnapPoints ,
607611 isInTemporaryPosition ,
612+ isAnimatedOnMount ,
608613 keyboardBehavior ,
609614 keyboardBlurBehavior ,
615+ _providedIndex ,
610616 ]
611617 ) ;
612618 const handleOnChange = useCallback (
@@ -1271,7 +1277,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
12711277 nextPosition = animatedClosedPosition . value ;
12721278 animatedNextPositionIndex . value = - 1 ;
12731279 } else {
1274- nextPosition = animatedSnapPoints . value [ _providedIndex ] ;
1280+ nextPosition = getNextPosition ( ) ;
12751281 }
12761282
12771283 runOnJS ( print ) ( {
@@ -1425,41 +1431,52 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
14251431 )
14261432 : Math . abs ( _keyboardHeight - animatedContainerOffset . value . bottom ) ;
14271433
1434+ /**
1435+ * if keyboard state is equal to the previous state, then exit the method
1436+ */
1437+ if (
1438+ _keyboardState === _previousKeyboardState &&
1439+ _keyboardHeight === _previousKeyboardHeight
1440+ ) {
1441+ return ;
1442+ }
1443+
1444+ /**
1445+ * if user is interacting with sheet, then exit the method
1446+ */
14281447 const hasActiveGesture =
14291448 animatedContentGestureState . value === State . ACTIVE ||
14301449 animatedContentGestureState . value === State . BEGAN ||
14311450 animatedHandleGestureState . value === State . ACTIVE ||
14321451 animatedHandleGestureState . value === State . BEGAN ;
1452+ if ( hasActiveGesture ) {
1453+ return ;
1454+ }
1455+
1456+ /**
1457+ * if sheet not animated on mount yet, then exit the method
1458+ */
1459+ if ( ! isAnimatedOnMount . value ) {
1460+ return ;
1461+ }
1462+
1463+ /**
1464+ * if new keyboard state is hidden and blur behavior is none, then exit the method
1465+ */
1466+ if (
1467+ _keyboardState === KEYBOARD_STATE . HIDDEN &&
1468+ keyboardBlurBehavior === KEYBOARD_BLUR_BEHAVIOR . none
1469+ ) {
1470+ return ;
1471+ }
14331472
1473+ /**
1474+ * if platform is android and the input mode is resize, then exit the method
1475+ */
14341476 if (
1435- /**
1436- * if keyboard state is equal to the previous state, then exit the method
1437- */
1438- ( _keyboardState === _previousKeyboardState &&
1439- _keyboardHeight === _previousKeyboardHeight ) ||
1440- /**
1441- * if user is interacting with sheet, then exit the method
1442- */
1443- hasActiveGesture ||
1444- /**
1445- * if sheet not animated on mount yet, then exit the method
1446- */
1447- ! isAnimatedOnMount . value ||
1448- /**
1449- * if new keyboard state is hidden and blur behavior is none, then exit the method
1450- */
1451- ( _keyboardState === KEYBOARD_STATE . HIDDEN &&
1452- keyboardBlurBehavior === KEYBOARD_BLUR_BEHAVIOR . none ) ||
1453- /**
1454- * if platform is android and the input mode is resize, then exit the method
1455- */
1456- ( Platform . OS === 'android' &&
1457- keyboardBehavior === KEYBOARD_BEHAVIOR . interactive &&
1458- android_keyboardInputMode === KEYBOARD_INPUT_MODE . adjustResize ) ||
1459- /**
1460- * if the sheet is closing, then exit then method
1461- */
1462- animatedNextPositionIndex . value === - 1
1477+ Platform . OS === 'android' &&
1478+ keyboardBehavior === KEYBOARD_BEHAVIOR . interactive &&
1479+ android_keyboardInputMode === KEYBOARD_INPUT_MODE . adjustResize
14631480 ) {
14641481 animatedKeyboardHeightInContainer . value = 0 ;
14651482 return ;
@@ -1706,13 +1723,15 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
17061723 // isScrollableRefreshable,
17071724 // animatedScrollableContentOffsetY,
17081725 // keyboardState,
1709- // animatedIndex,
1710- // animatedCurrentIndex,
1711- // animatedPosition,
1712- animatedContainerHeight,
1713- animatedSheetHeight,
1714- animatedHandleHeight,
1715- animatedContentHeight,
1726+ animatedIndex,
1727+ animatedCurrentIndex,
1728+ animatedPosition,
1729+ animatedHandleGestureState,
1730+ animatedContentGestureState,
1731+ // animatedContainerHeight,
1732+ // animatedSheetHeight,
1733+ // animatedHandleHeight,
1734+ // animatedContentHeight,
17161735 // // keyboardHeight,
17171736 // isLayoutCalculated,
17181737 // isContentHeightFixed,
0 commit comments