📜  settimeout 反应本机焦点文本输入 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:44.989000             🧑  作者: Mango

代码示例1
const inputRef = useRef(null)

In onSubmitEditing prop, include this:

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

Ex:

const onEnterKeyPressed = () => {
      ...
    setTimeout(() => inputRef.current.focus(), 100);    
       ...
}