fix(gui): move focus into a folder when it opens

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.
This commit is contained in:
Nariman Jelveh
2026-08-07 21:20:44 -07:00
parent decbb4580b
commit a3fdd57446
+8 -1
View File
@@ -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 });
}
},