guard destroyed input field in timeout
parent
121016af81
commit
58ba486375
|
|
@ -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…
Reference in New Issue