Answers for "settimeout react native focus text input"

0

settimeout react native focus text input

const inputRef = useRef(null)

In onSubmitEditing prop, include this:

setTimeout(() => inputRef.current.focus(), 250);

Ex:

const onEnterKeyPressed = () => {
  	...
	setTimeout(() => inputRef.current.focus(), 100);	
   	...
}
<TextInput
	...
    onSubmitEditing={onEnterKeyPress}
	...
/>
Posted by: Guest on July-21-2021

Code answers related to "settimeout react native focus text input"

Code answers related to "Javascript"

Browse Popular Code Answers by Language