guard destroyed input field in timeout

pull/11095/head
Sebastian Herrlinger 2026-01-28 23:53:37 -05:00
parent 121016af81
commit 58ba486375
1 changed files with 5 additions and 1 deletions

View File

@ -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"}
/>