File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,12 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
166166 // prevent hiding the bottom sheet by
167167 const dismissOnDraggingDownSheet = bottomSheetOptions . options ?. dismissOnDraggingDownSheet !== false ;
168168 behavior . setHideable ( dismissOnDraggingDownSheet ) ;
169+
170+ const peekHeight = bottomSheetOptions . options ?. peekHeight ;
171+ if ( peekHeight ) {
172+ behavior . setState ( com . google . android . material . bottomsheet . BottomSheetBehavior . STATE_COLLAPSED ) ;
173+ behavior . setPeekHeight ( Utils . layout . toDevicePixels ( peekHeight ) ) ;
174+ }
169175 if ( ! dismissOnDraggingDownSheet ) {
170176 // directly expand the bottom sheet after start
171177 behavior . setState ( com . google . android . material . bottomsheet . BottomSheetBehavior . STATE_EXPANDED ) ;
@@ -179,11 +185,6 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
179185 // disable peek/collapsed state
180186 behavior . setSkipCollapsed ( true ) ;
181187 }
182- const peekHeight = bottomSheetOptions . options ?. peekHeight ;
183- if ( peekHeight ) {
184- behavior . setState ( com . google . android . material . bottomsheet . BottomSheetBehavior . STATE_COLLAPSED ) ;
185- behavior . setPeekHeight ( Utils . layout . toDevicePixels ( peekHeight ) ) ;
186- }
187188
188189 const onChangeState = bottomSheetOptions . options ?. onChangeState ;
189190 if ( onChangeState ) {
You can’t perform that action at this time.
0 commit comments