Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeClose() {
enableBodyScroll(this.$refs.modal);
this.$emit('before-close');
},
closed() {
return () => {
if (dialogNode) {
enableBodyScroll(dialogNode);
}
};
}, [isEnabled, preserveScrollBarGap]);
last && Math.abs(movementX) + Math.abs(movementY) <= 3 && !drawerIsOpen
if (isClick) return setDrawerOpen()
if (!memo) {
const isIntentionalGesture =
Math.abs(movementY) > threshold &&
Math.abs(movementY) > Math.abs(movementX)
if (!isIntentionalGesture) return
disableBodyScroll(nowPlayingDrawerRef.current)
memo = y.value - movementY
}
if (last) {
enableBodyScroll(nowPlayingDrawerRef.current)
const projectedEndpoint = y.value + projection(velocityY)
const point = findNearestNumberInArray(projectedEndpoint, stops)
return set({
y: point,
immediate: false,
config: spring
})
}
const newY = rubberBandIfOutOfBounds(
stops[stops.length - 1],
stops[0],
movementY + memo,
0.08
const handleClose = () => {
enableBodyScroll(modal.current);
setAlert(false);
};
useEffect(() => {
({ last, movement: [, movementY], vxvy: [, velocityY], memo }) => {
if (!memo) {
const isIntentionalGesture = Math.abs(movementY) > threshold
if (!isIntentionalGesture) return
memo = y.value - movementY
}
disableBodyScroll(containerRef.current)
if (last) {
enableBodyScroll(containerRef.current)
const projectedEndpoint = y.value + projection(velocityY)
const point = findNearestNumberInArray(
projectedEndpoint,
yStops.current
)
const notificationClosed = point === yStops.current[1]
return set({
y: notificationClosed ? yStops.current[1] : yStops.current[0],
onRest: notificationClosed ? removeDrawer : () => {},
immediate: false
})
}
disableScrollLock() {
if (!this.canLockScroll) return;
enableBodyScroll(this.scrollableNode.current);
}
() => () => {
const { current: body } = bodyRef;
if (body != null) {
enableBodyScroll(body);
}
const { current: focus } = focusRef;
if (focus != null) {
focus.deactivate();
}
},
[],
return () => enableBodyScroll(dialogNode);
}, [isOpen, blockScrollOnMount, preserveScrollBarGap]);