mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -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.initEventListeners();
|
||||||
this.loadSearchPreferences();
|
this.loadSearchPreferences();
|
||||||
|
this.setupKeyboardShortcuts();
|
||||||
|
|
||||||
updatePanelPositions();
|
updatePanelPositions();
|
||||||
|
|
||||||
@@ -36,6 +37,26 @@ export class SearchManager {
|
|||||||
window.addEventListener('resize', updatePanelPositions);
|
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() {
|
initEventListeners() {
|
||||||
// Search input event
|
// Search input event
|
||||||
if (this.searchInput) {
|
if (this.searchInput) {
|
||||||
|
|||||||
Reference in New Issue
Block a user