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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/InputNumber.tsx
Original file line number Diff line number Diff line change
@@ -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的一个默认样式。既然不用原生,这个就不需要坎

import KeyCode from 'rc-util/lib/KeyCode';
import { useLayoutUpdateEffect } from 'rc-util/lib/hooks/useLayoutEffect';
import { composeRef } from 'rc-util/lib/ref';
Expand Down Expand Up @@ -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 了。自定义格式后可以是任意形式,甚至是繁体数字 肆拾

autoComplete="off"
role="spinbutton"
aria-valuemin={min as any}
Expand Down