Fix rect selection in table view: prevent native text drag/selection

Added user-select:none and -webkit-user-drag:none to #entriesContainer.
Also added a dragstart listener that prevents default for any element
that is not [draggable='true'], stopping the browser from creating drag
ghosts of selected table text/headers during rectangle selection.
This commit is contained in:
2026-05-09 16:18:03 +01:00
parent efbf8f450a
commit 6a26dd78cb
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -1141,6 +1141,11 @@ if (token && curUser) {
}
})();
// Prevent native drag on non-card elements (table headers, text, etc.)
document.getElementById('entriesContainer').addEventListener('dragstart', function(e) {
if (!e.target?.closest?.('[draggable="true"]')) e.preventDefault();
});
// Document mousedown: rect selection on vault background, clear outside vault
document.addEventListener('mousedown', function(e) {
if (e.button !== 0 || rectState.active) return;