Fix: mousedown clears selectedIds before batch callback runs
Document mousedown handler was clearing selectedIds when clicking 'Yes' (button element). Since mousedown fires before click, selectedIds was empty by the time the async callback read it, causing no-op deletes but still showing the toast. Added .batch-confirm-overlay to the mousedown exclusion list so clicking the confirm dialog won't trigger clearSelection().
This commit is contained in:
@@ -1306,7 +1306,7 @@ document.getElementById('entriesContainer').addEventListener('dragstart', functi
|
||||
// Document mousedown: rect selection on vault background, clear outside vault
|
||||
document.addEventListener('mousedown', function(e) {
|
||||
if (e.button !== 0 || rectState.active) return;
|
||||
if (e.target?.closest?.('.entry-card,.entry-row,.entry-compact,.table-row-drag,.detail-card,.detail-nav,#batchBar,.custom-modal-overlay.show,.edit-modal.show,.modal-overlay.show,#genModal,#settingsMenu')) return;
|
||||
if (e.target?.closest?.('.entry-card,.entry-row,.entry-compact,.table-row-drag,.detail-card,.detail-nav,#batchBar,.custom-modal-overlay.show,.edit-modal.show,.modal-overlay.show,#genModal,#settingsMenu,.batch-confirm-overlay')) return;
|
||||
if (e.target?.closest?.('button,input,select,.folders-bar,.toolbar,#trashActions,.settings-dropdown,.fab,.auth-section')) {
|
||||
if (selectedIds.size > 0) clearSelection();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user