fix selection rect not disappearing when clicking empty space
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user