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
问题:h5 input 输入框 type=number 时,输入 1.2. 最后一个小数点不会触发 onChange
<input type="number" value={inputValue} onChange={(e)=>{this.bindInput(e)}} /> bindInput = (e) => { console.log('###',e.target.value) }
情况一:
输入 12,2,100 这样的整数,正常打印出 12,2,100
情况二:
输入 12. 只会打印出 12 如果输入 12.3 则可以打印出 12.3
情况三:
输入 1.23 打印出 1.23 输入 1.23. 也是输入 1.23
想要对 type= number 时进行小数点校验,暂无合适的方案,可以考虑自定义键盘,type 默认类型是可以做到小数点监测的。
如果项目中有使用到 antd,则使用 antd 中的自定义键盘,带上校验规则,完美适配;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题:h5 input 输入框 type=number 时,输入 1.2. 最后一个小数点不会触发 onChange
情况一:
输入 12,2,100 这样的整数,正常打印出 12,2,100
情况二:
输入 12. 只会打印出 12 如果输入 12.3 则可以打印出 12.3
情况三:
输入 1.23 打印出 1.23 输入 1.23. 也是输入 1.23
总结:
想要对 type= number 时进行小数点校验,暂无合适的方案,可以考虑自定义键盘,type 默认类型是可以做到小数点监测的。
如果项目中有使用到 antd,则使用 antd 中的自定义键盘,带上校验规则,完美适配;
The text was updated successfully, but these errors were encountered: