mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-07 17:31:54 +00:00
guard destroyed input field in timeout
This commit is contained in:
parent
121016af81
commit
58ba486375
1 changed files with 5 additions and 1 deletions
|
|
@ -241,7 +241,11 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||
focusedTextColor={theme.textMuted}
|
||||
ref={(r) => {
|
||||
input = r
|
||||
setTimeout(() => input.focus(), 1)
|
||||
setTimeout(() => {
|
||||
if (!input) return
|
||||
if (input.isDestroyed) return
|
||||
input.focus()
|
||||
}, 1)
|
||||
}}
|
||||
placeholder={props.placeholder ?? "Search"}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue