diff --git a/core/src/components/modal/gestures/sheet.ts b/core/src/components/modal/gestures/sheet.ts index 0e3fca6b8bb..3cdbe4cef9d 100644 --- a/core/src/components/modal/gestures/sheet.ts +++ b/core/src/components/modal/gestures/sheet.ts @@ -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((resolve) => { animation .onFinish( @@ -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