mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(sessions): keep search focus when switching picker tabs
This commit is contained in:
1 parent
87f28fbc6d
commit
abcecd1c0c
2 files changed
+31
-2
No files matched your search
@@ -734,8 +734,11 @@ export function SessionPickerDialog({
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || !hasFinePointer) return
|
||||
if (tab === 'projects') projectSearchInputRef.current?.focus()
|
||||
else searchInputRef.current?.focus()
|
||||
const frame = requestAnimationFrame(() => {
|
||||
if (tab === 'projects') projectSearchInputRef.current?.focus()
|
||||
else searchInputRef.current?.focus()
|
||||
})
|
||||
return () => cancelAnimationFrame(frame)
|
||||
}, [open, tab, hasFinePointer])
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user