Closed tianguzhe closed 3 months ago
问题描述 Input输入框 onInput事件触发setData后,会自动收起键盘
复现步骤
import { useState } from "react"; import { Input, View } from "@tarojs/components"; const TestPage = () => { const [inputValue, setInputValue] = useState(""); const handleInput = (e) => { setInputValue(e.detail.value); }; const SearchBar = () => { return ( <Input type="text" value={inputValue} onInput={handleInput} placeholder="请输入私教动作名称" focus={true} // 确保 Input 组件在初始化时获取焦点 /> ); }; return ( <View> <View style={{ height: 100, }} /> <SearchBar /> </View> ); }; export default TestPage;
期望行为
能持续输入文字,不要中断输入
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
提交错了仓库
问题描述 Input输入框 onInput事件触发setData后,会自动收起键盘
复现步骤
期望行为
能持续输入文字,不要中断输入