From baecb7ba8fe85eb2ec0eb977537bb4d140ef93bb Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Fri, 23 Oct 2026 14:24:18 -0700 Subject: [PATCH] fix(dashboard): keep keyboard focus on the Usage table's Show more/less The table redraws without the button that was pressed, so focus fell back to the page and the next Tab started from the top. Focus now moves to the button that replaces it, as the sort headers already do. --- src/gui/src/UI/Dashboard/TabUsage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/Dashboard/TabUsage.js b/src/gui/src/UI/Dashboard/TabUsage.js index 1dc77d361..1fea63ded 100644 --- a/src/gui/src/UI/Dashboard/TabUsage.js +++ b/src/gui/src/UI/Dashboard/TabUsage.js @@ -124,16 +124,20 @@ const TabUsage = { $($el_window).find(`.driver-usage-details-content-table th[data-sort="${column}"] .usage-sort-btn`).trigger('focus'); }); - // Click handler for "Show more" to expand the table + // Click handler for "Show more" to expand the table. The redrawn + // table has no clicked button; focus moves to the one replacing it + // (here and below), not to the top of the page. $($el_window).on('click', '.usage-table-show-more', function () { usageTableExpanded = true; renderUsageTable(); + $($el_window).find('.usage-table-show-less').trigger('focus'); }); // Click handler for "Show less" to collapse the table $($el_window).on('click', '.usage-table-show-less', function () { usageTableExpanded = false; renderUsageTable(); + $($el_window).find('.usage-table-show-more').trigger('focus'); }); }, // Refresh whenever the tab is (re)activated — otherwise the usage numbers