Skip to content

Commit

Permalink
feat: add '/' key shortcut to focus search input
Browse files Browse the repository at this point in the history
  • Loading branch information
thebracket committed Feb 26, 2025
1 parent dc62fb7 commit ce0a0fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rust/lqosd/src/node_manager/js_build/src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ function setupSearch() {
const search = $("#txtSearch").val();
doSearch(search);
});

// Add this new key handler for '/' to focus search
$(document).on('keydown', (e) => {
if (e.key === '/' && !$(e.target).is('input, textarea, select')) {
e.preventDefault();
$('#txtSearch').focus();
}
});
}

function setupReload() {
Expand All @@ -95,4 +103,4 @@ initDayNightMode();
initRedact();
getDeviceCounts();
setupSearch();
setupReload();
setupReload();

0 comments on commit ce0a0fc

Please sign in to comment.