From a3fdd57446d53efc98a754a6642e3126067d5e37 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Fri, 7 Aug 2026 21:20:44 -0700 Subject: [PATCH] fix(gui): move focus into a folder when it opens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening a folder called .focus({ preventScroll: true }) on a jQuery object. jQuery's .focus() shorthand reads a lone non-function argument as event DATA and binds a handler with it, so it never moved focus: the folder opened modal over the grid with focus still on the tile behind its scrim, where Tab walked away through the inert grid instead of cycling inside the dialog — and the object it bound as a handler threw a TypeError on that tile's every subsequent focus. Focus the DOM node instead, as every other focus call in this file already does. --- src/gui/src/UI/Dashboard/TabApps.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/Dashboard/TabApps.js b/src/gui/src/UI/Dashboard/TabApps.js index 0cdaca0ec..c50584693 100644 --- a/src/gui/src/UI/Dashboard/TabApps.js +++ b/src/gui/src/UI/Dashboard/TabApps.js @@ -1319,7 +1319,14 @@ const TabApps = { input.focus(); input.select(); } else { - $overlay.find('.myapps-tile').first().focus({ preventScroll: true }); + // The DOM node, not the jQuery wrapper: jQuery reads a lone + // object argument to .focus() as event DATA and binds a handler + // with it instead of moving focus — so the folder opened with + // focus still on the inert grid behind it (Tab then walked off + // through that grid, past this dialog's trap), and the bogus + // handler threw on the tile's every later focus. + const first = $overlay.find('.myapps-tile')[0]; + if ( first ) first.focus({ preventScroll: true }); } },