From 5596d9e28494af4d7e034f97258a5b04f1548698 Mon Sep 17 00:00:00 2001 From: Ivan Lednev Date: Thu, 17 Aug 2023 16:10:57 +0200 Subject: [PATCH] Fix move confirmation when cursor is on resize handle --- src/ui/components/task.svelte | 2 +- src/ui/hooks/use-resize.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/components/task.svelte b/src/ui/components/task.svelte index 1b1f679d4..08d5eff89 100644 --- a/src/ui/components/task.svelte +++ b/src/ui/components/task.svelte @@ -73,7 +73,7 @@
+ on:mouseup={() => handleResizeConfirm(text, height, startMinutes)} >
diff --git a/src/ui/hooks/use-resize.ts b/src/ui/hooks/use-resize.ts index b78510116..c3638430a 100644 --- a/src/ui/hooks/use-resize.ts +++ b/src/ui/hooks/use-resize.ts @@ -1,6 +1,6 @@ import { sizeToDuration } from "src/store/timeline-store"; import { updateTimestamps } from "src/store/update-timestamp"; -import { writable } from "svelte/store"; +import { get, writable } from "svelte/store"; export function useResize() { const resizing = writable(false); @@ -19,6 +19,10 @@ export function useResize() { // todo: don't need start minutes here startMinutes: number, ) { + if (!get(resizing)) { + return; + } + resizing.set(false); const newDurationMinutes = sizeToDuration(taskHeight);