File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
core/src/components/modal/gestures Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -328,18 +328,6 @@ export const createSheetGesture = (
328328 } ;
329329
330330 const onEnd = ( detail : GestureDetail ) => {
331- /**
332- * When the gesture releases, we need to determine
333- * the closest breakpoint to snap to.
334- */
335- const velocity = detail . velocityY ;
336- const threshold = ( detail . deltaY + velocity * 350 ) / height ;
337-
338- const diff = currentBreakpoint - threshold ;
339- const closest = breakpoints . reduce ( ( a , b ) => {
340- return Math . abs ( b - diff ) < Math . abs ( a - diff ) ? b : a ;
341- } ) ;
342-
343331 /**
344332 * If expandToScroll is disabled, we should not allow the moveSheetToBreakpoint
345333 * function to be called if the user is trying to swipe upwards and the content
@@ -353,6 +341,18 @@ export const createSheetGesture = (
353341 }
354342 }
355343
344+ /**
345+ * When the gesture releases, we need to determine
346+ * the closest breakpoint to snap to.
347+ */
348+ const velocity = detail . velocityY ;
349+ const threshold = ( detail . deltaY + velocity * 350 ) / height ;
350+
351+ const diff = currentBreakpoint - threshold ;
352+ const closest = breakpoints . reduce ( ( a , b ) => {
353+ return Math . abs ( b - diff ) < Math . abs ( a - diff ) ? b : a ;
354+ } ) ;
355+
356356 moveSheetToBreakpoint ( {
357357 breakpoint : closest ,
358358 breakpointOffset : offset ,
You can’t perform that action at this time.
0 commit comments