From b0ac4f1038337247c58cecfecf2bc21e8e616f17 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Mon, 17 Aug 2026 22:16:39 -0700 Subject: [PATCH] fix(dashboard): stop Files-tab shortcuts from firing behind the share modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The document-level keydown.tabfiles handler kept running while the share (or item-properties) modal was open. With focus on any of the modal's buttons or selects, Enter and Space were preventDefault-ed before they could activate the control, arrows could not drive the mode selects, and letter typeahead was hijacked into row typesearch — while Enter opened the selected row behind the overlay, Delete moved it to Trash, and Cmd+A/C/X/V acted on the hidden list. Yield the keyboard to the modal for as long as one is up; its own handlers already cover Escape and Tab. --- src/gui/src/UI/Dashboard/TabFiles.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/src/UI/Dashboard/TabFiles.js b/src/gui/src/UI/Dashboard/TabFiles.js index d3e771f65..9acb2114e 100644 --- a/src/gui/src/UI/Dashboard/TabFiles.js +++ b/src/gui/src/UI/Dashboard/TabFiles.js @@ -664,6 +664,12 @@ const TabFiles = { // Only handle if Dashboard Files tab is active if ( ! _this.isDashboardFilesActive() ) return; + // A Files-tab modal (share, item properties) owns the keyboard + // while open: Enter/Space must reach its buttons, arrows its + // selects, and typing must not retarget row selection — nor may + // Enter/Delete open or trash the rows behind the overlay. + if ( $('.share-modal-overlay, .item-props-overlay').length > 0 ) return; + const focused_el = document.activeElement; // Skip if user is typing in an input/textarea (except for Escape)