Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

Sunny-117
Copy link

issue:
#539

经过分析,原生html默认行为即可

@vercel
Copy link

vercel bot commented Feb 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
input-number ❌ Failed (Inspect) Feb 15, 2023 at 11:45AM (UTC)

@Sunny-117
Copy link
Author

Sunny-117 commented Feb 15, 2023

Input Number 数字输入框 本来就应该仅允许输入标准的数字值,而原生input:number 本来默认支持

@yoyo837
Copy link
Member

yoyo837 commented Feb 15, 2023

原生还支持字母e,科学计数法

@Sunny-117
Copy link
Author

原生还支持字母e,科学计数法

这样我在换种方式,不用原生

@@ -1,5 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import './index.css';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥要 引入这个文件呀

Copy link
Author

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还有 format 属性,这个属性配置了 type 就不能是 number 了。自定义格式后可以是任意形式,甚至是繁体数字 肆拾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants