-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
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
fix: input bug #540
fix: input bug #540
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Input Number 数字输入框 本来就应该仅允许输入标准的数字值,而原生input:number 本来默认支持 |
原生还支持字母e,科学计数法 |
这样我在换种方式,不用原生 |
@@ -1,5 +1,6 @@ | |||
import * as React from 'react'; | |||
import classNames from 'classnames'; | |||
import './index.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要 引入这个文件呀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉原生input:number的一个默认样式。既然不用原生,这个就不需要坎
@@ -562,6 +563,7 @@ const InputNumber = React.forwardRef( | |||
)} | |||
<div className={`${inputClassName}-wrap`}> | |||
<input | |||
type="number" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有 format 属性,这个属性配置了 type 就不能是 number 了。自定义格式后可以是任意形式,甚至是繁体数字 肆拾
issue:
#539
经过分析,原生html默认行为即可