From fa169d2dca649107342fe365ef6c7da892ebb8fd Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Fri, 9 Sep 2022 14:26:17 -0500 Subject: [PATCH] fix(modal): sheet is easier to dismiss with swipe (#25883) resolves #24296 --- core/src/components/modal/gestures/sheet.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/components/modal/gestures/sheet.ts b/core/src/components/modal/gestures/sheet.ts index cd1c51247f..06c05fb4e0 100644 --- a/core/src/components/modal/gestures/sheet.ts +++ b/core/src/components/modal/gestures/sheet.ts @@ -234,7 +234,8 @@ export const createSheetGesture = ( * the closest breakpoint to snap to. */ const velocity = detail.velocityY; - const threshold = (detail.deltaY + velocity * 100) / height; + const threshold = (detail.deltaY + velocity * 350) / height; + const diff = currentBreakpoint - threshold; const closest = breakpoints.reduce((a, b) => { return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;