Skip to content

Commit f4cf4c1

Browse files
committed
chore: added comments explaining footer visibility swaps
1 parent 4052a86 commit f4cf4c1

File tree

1 file changed

+11
-0
lines changed
  • core/src/components/modal/gestures

1 file changed

+11
-0
lines changed

core/src/components/modal/gestures/sheet.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ export const createSheetGesture = (
229229
*/
230230
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
231231

232+
/**
233+
* If scrollAtEdge is disabled, we need to swap
234+
* the visibility to the original, so if the modal
235+
* is dismissed, the footer dismisses with the modal
236+
* and doesn't stay on the screen after the modal is gone.
237+
*/
232238
if (!scrollAtEdge) {
233239
swapFooterVisibility('original')
234240
}
@@ -392,6 +398,11 @@ export const createSheetGesture = (
392398
*/
393399
gesture.enable(false);
394400

401+
/**
402+
* If scrollAtEdge is disabled, we need to swap
403+
* the visibility to the cloned one so the footer
404+
* doesn't flicker when the sheet's height is animated.
405+
*/
395406
if (!scrollAtEdge && shouldRemainOpen) {
396407
swapFooterVisibility('cloned');
397408
}

0 commit comments

Comments
 (0)