feat(ui): route Ctrl+F search by focused surface
This commit is contained in:
23 files changed
+233
-56
No files matched your search
@@ -2292,7 +2292,16 @@ watch(
|
||||
{ flush: "post" },
|
||||
);
|
||||
|
||||
function focusSearch(): boolean {
|
||||
function focusSearch(target: Element | null = null): boolean {
|
||||
const tableSearchControl = target?.closest<HTMLElement>("[data-sidebar-table-search-control]");
|
||||
if (tableSearchControl) {
|
||||
const input = tableSearchControl.querySelector<HTMLInputElement>("[data-sidebar-table-search-parent-id]");
|
||||
if (input) {
|
||||
input.focus();
|
||||
input.select();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
const input = searchInputRef.value;
|
||||
if (!input) return false;
|
||||
input.focus();
|
||||
|
||||
Reference in new issue
Block a user