@@ -46,6 +46,11 @@ type Props = {
46
46
*/
47
47
enabledBottomClamp ?: boolean
48
48
49
+ /**
50
+ * When true, sheet will grows up from bottom to initial snapPoint.
51
+ */
52
+ enabledBottomInitialAnimation ?: boolean
53
+
49
54
/**
50
55
* If false blocks snapping using snapTo method. Defaults to true.
51
56
*/
@@ -293,6 +298,7 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
293
298
enabledImperativeSnapping : true ,
294
299
enabledGestureInteraction : true ,
295
300
enabledBottomClamp : false ,
301
+ enabledBottomInitialAnimation : false ,
296
302
enabledHeaderGestureInteraction : true ,
297
303
enabledContentGestureInteraction : true ,
298
304
enabledContentTapInteraction : true ,
@@ -725,10 +731,19 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
725
731
726
732
const { initialSnap } = props
727
733
734
+ let init =
735
+ sortedPropsSnapPoints [ 0 ] . val -
736
+ sortedPropsSnapPoints [ propsToNewIndices [ initialSnap ] ] . val
737
+
738
+ if ( props . enabledBottomInitialAnimation ) {
739
+ init =
740
+ sortedPropsSnapPoints [
741
+ sortedPropsSnapPoints . length - 1 - propsToNewIndices [ initialSnap ]
742
+ ] . val
743
+ }
744
+
728
745
return {
729
- init :
730
- sortedPropsSnapPoints [ 0 ] . val -
731
- sortedPropsSnapPoints [ propsToNewIndices [ initialSnap ] ] . val ,
746
+ init,
732
747
propsToNewIndices,
733
748
heightOfHeaderAnimated :
734
749
( state && state . heightOfHeaderAnimated ) || new Value ( 0 ) ,
0 commit comments