mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: Add keyboard shortcuts for search input focus and selection
This commit is contained in:
@@ -29,6 +29,7 @@ export class SearchManager {
|
||||
|
||||
this.initEventListeners();
|
||||
this.loadSearchPreferences();
|
||||
this.setupKeyboardShortcuts();
|
||||
|
||||
updatePanelPositions();
|
||||
|
||||
@@ -36,6 +37,26 @@ export class SearchManager {
|
||||
window.addEventListener('resize', updatePanelPositions);
|
||||
}
|
||||
|
||||
// Add this new method to setup keyboard shortcuts
|
||||
setupKeyboardShortcuts() {
|
||||
// Add global keyboard shortcut listener for Ctrl+F or Cmd+F
|
||||
document.addEventListener('keydown', (e) => {
|
||||
// Check for Ctrl+F (Windows/Linux) or Cmd+F (Mac)
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === 'f') {
|
||||
// Prevent default browser search behavior
|
||||
e.preventDefault();
|
||||
|
||||
// Focus the search input if it exists
|
||||
if (this.searchInput) {
|
||||
this.searchInput.focus();
|
||||
|
||||
// Optionally select all text in the search input for easy replacement
|
||||
this.searchInput.select();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initEventListeners() {
|
||||
// Search input event
|
||||
if (this.searchInput) {
|
||||
|
||||
Reference in New Issue
Block a user