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
受控组件时,input点击clear按钮时,会触发onChange事件同时也会触发失焦事件里的onChange,此时e.detail.value获取到的依然是输入值的值而不是空,导致点击两次才会清空value
const [val, setVal] = useStae('') // setVal是异步的 onChange = (value) => { setVal(value) return value }
组件源码问题
onBlur = event => { this.props.onBlur(event.target.value, event) // fix # 583 AtInput 不触发 onChange 的问题 this.props.onChange(event.target.value, event) }
The text was updated successfully, but these errors were encountered:
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
Sorry, something went wrong.
31074a3
还是没有解决呀
if (!event || event.type === 'input'){
只能这样做一下判断了
private handleClearValue = (event: ITouchEvent): void => { this.inputClearing = true this.props.onChange?.('', event) }
{clear && value && ( <View className='at-input__icon' onTouchEnd={this.handleClearValue}> <Text className='at-icon at-icon-close-circle at-input__icon-close'></Text> </View> )}
这段源码不生效
AwesomeDevin
No branches or pull requests
受控组件时,input点击clear按钮时,会触发onChange事件同时也会触发失焦事件里的onChange,此时e.detail.value获取到的依然是输入值的值而不是空,导致点击两次才会清空value
组件源码问题
The text was updated successfully, but these errors were encountered: