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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user