Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions core/src/components/modal/gestures/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@ export const createSheetGesture = (
onDismiss();
}

/**
* If the sheet is going to be fully expanded then we should enable
* scrolling immediately. The sheet modal animation takes ~500ms to finish
* so if we wait until then there is a visible delay for when scrolling is
* re-enabled. Native iOS allows for scrolling on the sheet modal as soon
* as the gesture is released, so we align with that.
*/
if (contentEl && snapToBreakpoint === breakpoints[breakpoints.length - 1]) {
contentEl.scrollY = true;
}

return new Promise<void>((resolve) => {
animation
.onFinish(
Expand All @@ -334,14 +345,6 @@ export const createSheetGesture = (
currentBreakpoint = snapToBreakpoint;
onBreakpointChange(currentBreakpoint);

/**
* If the sheet is fully expanded, we can safely
* enable scrolling again.
*/
if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
contentEl.scrollY = true;
}

/**
* Backdrop should become enabled
* after the backdropBreakpoint value
Expand Down