feat(ui): route Ctrl+F search by focused surface

This commit is contained in:
zipg authored and GitHub committed 2026-09-15 23:20:05 +08:00
1 parent 4c80d16e26
commit 3c8ae159fb
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();