fix selection rect not disappearing when clicking empty space

This commit is contained in:
2025-09-05 17:16:24 +02:00
parent 8c4f56a7ab
commit 73d3b2a27f

View File

@@ -43,23 +43,25 @@ function onDocumentPointerUp(e: MouseEvent) {
return;
}
if (!rect.isMinSize()) {
warrenStore.clearSelection();
return;
}
const left = Math.min(rect.a.x, rect.b.x);
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);
const isMinSize = rect.isMinSize();
rect.disable();
if (warrenStore.current == null || warrenStore.current.dir == null) {
return;
}
if (!isMinSize) {
warrenStore.clearSelection();
return;
}
const entryElements = document.querySelectorAll('[data-entry-index]');
const targetEntries = [];