mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-05 13:35:20 +00:00
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.
This commit is contained in:
1 parent
eef34ce4c8
commit
baecb7ba8f
1 file changed
+5
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user