@@ -179,6 +179,13 @@ export const createSheetGesture = (
179
179
// sheet has been moved below the footer. When that happens, we need to swap
180
180
// the position back so it will collapse correctly.
181
181
cachedFooterYPosition = absoluteTop ;
182
+ // If there's a toolbar, we need to combine the toolbar height with the footer position
183
+ // because the toolbar moves with the drag handle, so when it starts overlapping the footer,
184
+ // we need to account for that.
185
+ const toolbar = baseEl . querySelector ( 'ion-toolbar' ) as HTMLIonToolbarElement | null ;
186
+ if ( toolbar ) {
187
+ cachedFooterYPosition -= toolbar . clientHeight ;
188
+ }
182
189
183
190
document . body . appendChild ( cachedFooterEl ) ;
184
191
}
@@ -500,11 +507,13 @@ export const createSheetGesture = (
500
507
}
501
508
502
509
/**
503
- * If expandToScroll is disabled, we need to swap
510
+ * If expandToScroll is disabled and we're animating
511
+ * to the close of the sheet, we need to swap
504
512
* the footer position to stationary so that it
505
- * will act as it would by default
513
+ * will collapse correctly. We cannot just always swap
514
+ * here or it'll be jittery while animating movement.
506
515
*/
507
- if ( ! expandToScroll ) {
516
+ if ( ! expandToScroll && snapToBreakpoint === 0 ) {
508
517
swapFooterPosition ( 'stationary' ) ;
509
518
}
510
519
@@ -513,6 +522,13 @@ export const createSheetGesture = (
513
522
. onFinish (
514
523
( ) => {
515
524
if ( shouldRemainOpen ) {
525
+ /**
526
+ * If expandToScroll is disabled, we need to swap
527
+ * the footer position to stationary so that it
528
+ * will act as it would by default
529
+ */
530
+ swapFooterPosition ( 'stationary' ) ;
531
+
516
532
/**
517
533
* Once the snapping animation completes,
518
534
* we need to reset the animation to go
0 commit comments