From fec1bf727c2ca3e0e948106e301f81edea27e9ea Mon Sep 17 00:00:00 2001 From: Alberto Monterroso <14013679+Albermonte@users.noreply.github.com> Date: Wed, 6 Sep 2023 08:42:30 -0400 Subject: [PATCH] Improved dragging to close when cards have no image --- src/components/atoms/SheetModal.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/atoms/SheetModal.vue b/src/components/atoms/SheetModal.vue index 4180f078..5c001139 100644 --- a/src/components/atoms/SheetModal.vue +++ b/src/components/atoms/SheetModal.vue @@ -84,7 +84,7 @@ function onMove(event: PointerEvent) { newProgress = Math.min(yDelta, heightDifference.value) / heightDifference.value else // Dragging down to close list - newProgress = Math.min(yDelta, heightDifference.value) / heightDifference.value + newProgress = Math.min(yDelta, initialHeight.value) / initialHeight.value } emit('update:progress', newProgress) } @@ -146,7 +146,7 @@ function onCardDrag(progress: number) { style.value = { height: isOpen.value ? 'min-content' : progress > 0 ? `${initialHeight.value + heightDifference.value * progress}px` : 'min-content', - // Set to -8 for closing list, -10 would be more "accurate" more -8 feels more natural + // Set to -6 for closing list, -8 would be more "accurate" more -6 feels more natural marginBottom: `${(1 - (progress >= 0 ? progress : progress * -6)) * props.initialGapToScreen}px`, borderBottomRightRadius: `${radius}px`, borderBottomLeftRadius: `${radius}px`,