diff --git a/frontend/components/SelectionRect.vue b/frontend/components/SelectionRect.vue index 53ff10b..b1517bb 100644 --- a/frontend/components/SelectionRect.vue +++ b/frontend/components/SelectionRect.vue @@ -43,9 +43,8 @@ function onDocumentPointerUp(e: MouseEvent) { return; } - rect.disable(); - - if (warrenStore.current == null || warrenStore.current.dir == null) { + if (!rect.isMinSize()) { + warrenStore.clearSelection(); return; } @@ -53,14 +52,14 @@ function onDocumentPointerUp(e: MouseEvent) { const top = Math.min(rect.a.y, rect.b.y); const width = Math.abs(rect.a.x - rect.b.x); const height = Math.abs(rect.a.y - rect.b.y); + const selectionRect = new DOMRect(left, top, width, height); - if (!rect.isMinSize()) { - warrenStore.clearSelection(); + rect.disable(); + + if (warrenStore.current == null || warrenStore.current.dir == null) { return; } - const selectionRect = new DOMRect(left, top, width, height); - const entryElements = document.querySelectorAll('[data-entry-index]'); const targetEntries = [];