guard destroyed input field in timeout
This commit is contained in:
@@ -241,7 +241,11 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||||||
focusedTextColor={theme.textMuted}
|
focusedTextColor={theme.textMuted}
|
||||||
ref={(r) => {
|
ref={(r) => {
|
||||||
input = r
|
input = r
|
||||||
setTimeout(() => input.focus(), 1)
|
setTimeout(() => {
|
||||||
|
if (!input) return
|
||||||
|
if (input.isDestroyed) return
|
||||||
|
input.focus()
|
||||||
|
}, 1)
|
||||||
}}
|
}}
|
||||||
placeholder={props.placeholder ?? "Search"}
|
placeholder={props.placeholder ?? "Search"}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user