fix(modal): sheet is easier to dismiss with swipe (#25883)

resolves #24296
This commit is contained in:
Liam DeBeasi
2022-09-09 14:26:17 -05:00
committed by GitHub
parent fb653ebe67
commit fa169d2dca

View File

@ -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;