From 38673ec327af645d4d372ea83338ca8cf6d489db Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Fri, 7 Aug 2026 21:34:10 -0700 Subject: [PATCH] fix(gui): keep Enter in a folder's name box from leaving the folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Committing the name with Enter blurred the box, which left focus on — outside a dialog that is marked aria-modal and that traps Tab on its own subtree. The next Tab therefore walked off through the inert grid the folder is covering, exactly what the trap exists to prevent. Step out onto the folder's first app instead; the same blur still commits the name. The keystroke is stopped at the box because the grid's document-level key handler reads Enter on a focused tile as "launch it", and would otherwise have taken the focus move as its cue to open an app the user never asked for. --- src/gui/src/UI/Dashboard/TabApps.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/Dashboard/TabApps.js b/src/gui/src/UI/Dashboard/TabApps.js index d3420d932..a13f81677 100644 --- a/src/gui/src/UI/Dashboard/TabApps.js +++ b/src/gui/src/UI/Dashboard/TabApps.js @@ -1380,7 +1380,19 @@ const TabApps = { $name.on('keydown', function (e) { if ( e.key === 'Enter' ) { e.preventDefault(); - this.blur(); + // The name box owns this Enter: the grid's document-level key + // handler reads Enter on a focused tile as "launch it", and + // the focus move below would hand it exactly that — the same + // keystroke would name the folder AND open an app out of it. + e.stopPropagation(); + // Step out onto the folder's contents rather than just + // blurring: a bare blur leaves focus on , outside this + // dialog, where the next Tab walks off into the inert grid + // the folder is covering. Moving focus still commits the + // name — that is the same blur. + const first = $overlay.find('.myapps-group-panel-grid .myapps-tile')[0]; + if ( first ) first.focus({ preventScroll: true }); + else this.blur(); } }); $name.on('change blur', function () {