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): update input onChange ts and file #4271

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/input/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
| value | 当前值 | String/Number | - | |
| size | 尺寸<br/><br/>**可选值**:<br/>'small'(小)<br/>'medium'(中)<br/>'large'(大) | Enum | 'medium' | |
| defaultValue | 初始化值 | String/Number | - | |
| onChange | 发生改变的时候触发的回调<br/><br/>**签名**:<br/>Function(value: String, e: Event) => void<br/>**参数**:<br/>_value_: {String} 数据<br/>_e_: {Event} DOM事件对象 | Function | func.noop | |
| onChange | 发生改变的时候触发的回调<br/><br/>**签名**:<br/>Function(value: String, e: Event) => void<br/>**参数**:<br/>_value_: {String} 数据<br/>_e_: {Event} DOM事件对象<br>_type_: {String} 点击hasClear时有此参数值为'clear' | Function | func.noop | |
| onKeyDown | 键盘按下的时候触发的回调<br/><br/>**签名**:<br/>Function(e: Event, opts: Object) => void<br/>**参数**:<br/>_e_: {Event} DOM事件对象<br/>_opts_: {Object} 可扩展的附加信息:<br> - opts.overMaxLength: {Boolean} 已超出最大长度<br> - opts.beTrimed: {Boolean} 输入的空格被清理 | Function | func.noop | |
| disabled | 禁用状态 | Boolean | false | |
| maxLength | 最大长度 | Number | null | |
Expand Down Expand Up @@ -65,7 +65,7 @@
| value | 当前值 | String/Number | - | |
| size | 尺寸<br/><br/>**可选值**:<br/>'small'(小)<br/>'medium'(中)<br/>'large'(大) | Enum | 'medium' | |
| defaultValue | 初始化值 | String/Number | - | |
| onChange | 发生改变的时候触发的回调<br/><br/>**签名**:<br/>Function(value: String, e: Event) => void<br/>**参数**:<br/>_value_: {String} 数据<br/>_e_: {Event} DOM事件对象 | Function | func.noop | |
| onChange | 发生改变的时候触发的回调<br/><br/>**签名**:<br/>Function(value: String, e: Event) => void<br/>**参数**:<br/>_value_: {String} 数据<br/>_e_: {Event} DOM事件对象<br>_type_: {String} 点击hasClear时有此参数值为'clear' | Function | func.noop | |
| onKeyDown | 键盘按下的时候触发的回调<br/><br/>**签名**:<br/>Function(e: Event, opts: Object) => void<br/>**参数**:<br/>_e_: {Event} DOM事件对象<br/>_opts_: {Object} 可扩展的附加信息:<br> - opts.overMaxLength: {Boolean} 已超出最大长度<br> - opts.beTrimed: {Boolean} 输入的空格被清理 | Function | func.noop | |
| disabled | 禁用状态 | Boolean | false | |
| maxLength | 最大长度 | Number | null | |
Expand Down
4 changes: 2 additions & 2 deletions types/input/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface TextAreaProps extends HTMLAttributesWeak, CommonProps {
/**
* 发生改变的时候触发的回调
*/
onChange?: (value: string, e: React.ChangeEvent<HTMLTextAreaElement>) => void;
onChange?: (value: string, e: React.ChangeEvent<HTMLTextAreaElement>, type?: string) => void;

/**
* 键盘按下的时候触发的回调
Expand Down Expand Up @@ -185,7 +185,7 @@ export interface InputProps extends HTMLAttributesWeak, CommonProps {
/**
* 发生改变的时候触发的回调
*/
onChange?: (value: string, e: React.ChangeEvent<HTMLInputElement>) => void;
onChange?: (value: string, e: React.ChangeEvent<HTMLInputElement>, type?: string) => void;

/**
* 键盘按下的时候触发的回调
Expand Down