🆙 Upgrade rc-input-number (#18346)

* fix react warning #9792

* support onPressEnter
close #12476
close #16080
This commit is contained in:
偏右 2019-08-19 16:32:19 +08:00 committed by GitHub
parent a5f1fc80fd
commit c9cef60d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,7 @@ When a numeric value needs to be provided.
| step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 | |
| value | current value | number | | |
| onChange | The callback triggered when the value is changed. | function(value: number \| string) | | |
| onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | |
## Methods

View File

@ -29,6 +29,7 @@ export interface InputNumberProps
name?: string;
id?: string;
precision?: number;
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
}
export default class InputNumber extends React.Component<InputNumberProps, any> {

View File

@ -30,6 +30,7 @@ title: InputNumber
| step | 每次改变步数,可以为小数 | number\|string | 1 | |
| value | 当前值 | number | | |
| onChange | 变化回调 | Function(value: number \| string) | | |
| onPressEnter | 按下回车的回调 | function(e) | | |
## 方法

View File

@ -68,7 +68,7 @@
"rc-dropdown": "~2.4.1",
"rc-editor-mention": "^1.1.13",
"rc-form": "^2.4.5",
"rc-input-number": "~4.4.5",
"rc-input-number": "~4.5.0",
"rc-mentions": "~0.4.0",
"rc-menu": "~7.4.23",
"rc-notification": "~3.3.1",