We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native
使用框架: React
Taro-rn 的 Input组件的focus属性有点歧义啊,Input组件封装的是rn的TextInput, TextInput的autoFocus只是在componentDidMount or useEffect时起作用。所以Input组件的focus也只是在mount的时候起作用,之后改变focus的state并不会起到focus的作用,要focus到一个input需要实现TextInput的focus()方法。
不支持 focus blur clear is Focused 方法
支持 focus blur clear is Focused 方法
👽 Taro v3.3.15 Taro CLI 3.3.15 environment info: System: OS: macOS 12.0.1 Shell: 5.8 - /bin/zsh Binaries: Node: 15.12.0 - /usr/local/bin/node Yarn: 1.22.10 - ~/.nvm/versions/node/v15.12.0/bin/yarn npm: 7.6.3 - ~/.nvm/versions/node/v15.12.0/bin/npm npmPackages: @tarojs/cli: 3.3.15 => 3.3.15 @tarojs/components: 3.3.15 => 3.3.15 @tarojs/mini-runner: 3.3.15 => 3.3.15 @tarojs/react: 3.3.15 => 3.3.15 @tarojs/runtime: 3.3.15 => 3.3.15 @tarojs/taro: 3.3.15 => 3.3.15 @tarojs/webpack-runner: 3.3.15 => 3.3.15 babel-preset-taro: 3.3.15 => 3.3.15 eslint-config-taro: 3.3.15 => 3.3.15 react: ^17.0.2 => 17.0.2 react-native: ^0.66.0 => 0.66.3 npmGlobalPackages: typescript: 4.2.3
The text was updated successfully, but these errors were encountered:
todo: 使用 forwardedRef 包装相应组件。用户可以通过 ref 进行调用。
Sorry, something went wrong.
clear 可以不用到,受控时直接设置值为空就行了,除非考虑不受控清空的场景。
focus blur: autofocus 只有mount时生效,其他端的这个属性已经“(即将废弃,请直接使用 focus )自动聚焦,拉起键盘”,不建议使用,使用 focus 就行了。
isFocused 方法取内置状态,应该也用的不多,如果传 focus props 受控的话,外部也能同步 focus 状态,同 clear,所以 ref 话好像意义也不大。
#12466
No branches or pull requests
相关平台
React Native
使用框架: React
复现步骤
Taro-rn 的 Input组件的focus属性有点歧义啊,Input组件封装的是rn的TextInput, TextInput的autoFocus只是在componentDidMount or useEffect时起作用。所以Input组件的focus也只是在mount的时候起作用,之后改变focus的state并不会起到focus的作用,要focus到一个input需要实现TextInput的focus()方法。
期望结果
不支持 focus blur clear is Focused 方法
实际结果
支持 focus blur clear is Focused 方法
环境信息
The text was updated successfully, but these errors were encountered: