mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(modal): sheet is easier to dismiss with swipe (#25883)
resolves #24296
This commit is contained in:
@ -234,7 +234,8 @@ export const createSheetGesture = (
|
|||||||
* the closest breakpoint to snap to.
|
* the closest breakpoint to snap to.
|
||||||
*/
|
*/
|
||||||
const velocity = detail.velocityY;
|
const velocity = detail.velocityY;
|
||||||
const threshold = (detail.deltaY + velocity * 100) / height;
|
const threshold = (detail.deltaY + velocity * 350) / height;
|
||||||
|
|
||||||
const diff = currentBreakpoint - threshold;
|
const diff = currentBreakpoint - threshold;
|
||||||
const closest = breakpoints.reduce((a, b) => {
|
const closest = breakpoints.reduce((a, b) => {
|
||||||
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
||||||
|
|||||||
Reference in New Issue
Block a user