Skip to content

fix: input-number ready not work #2971 #3968

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

Merged
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
5 changes: 4 additions & 1 deletion components/input-number/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ const InputNumber = {
},

render() {
const { prefixCls: customizePrefixCls, size, ...others } = getOptionProps(this);
const { prefixCls: customizePrefixCls, size, ...others } = {
...getOptionProps(this),
...this.$attrs,
};
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('input-number', customizePrefixCls);

Expand Down
12 changes: 6 additions & 6 deletions components/vc-input-number/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const inputNumberProps = {
disabled: PropTypes.bool,
// onFocus: PropTypes.func,
// onBlur: PropTypes.func,
readOnly: PropTypes.bool,
readonly: PropTypes.bool,
max: PropTypes.number,
min: PropTypes.number,
step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
Expand Down Expand Up @@ -637,7 +637,7 @@ export default {
const {
prefixCls,
disabled,
readOnly,
readonly,
useTouch,
autoComplete,
upHandler,
Expand Down Expand Up @@ -666,7 +666,7 @@ export default {
}
}

const editable = !this.readOnly && !this.disabled;
const editable = !this.readonly && !this.disabled;

// focus state, show input value
// unfocus state, show valid value
Expand Down Expand Up @@ -695,8 +695,8 @@ export default {
mouseleave: this.stop,
};
}
const isUpDisabled = !!upDisabledClass || disabled || readOnly;
const isDownDisabled = !!downDisabledClass || disabled || readOnly;
const isUpDisabled = !!upDisabledClass || disabled || readonly;
const isDownDisabled = !!downDisabledClass || disabled || readonly;
const {
mouseenter = noop,
mouseleave = noop,
Expand Down Expand Up @@ -778,7 +778,7 @@ export default {
onBlur={this.onBlur}
onKeydown={editable ? this.onKeyDown : noop}
onKeyup={editable ? this.onKeyUp : noop}
readOnly={this.readOnly}
readonly={this.readonly}
disabled={this.disabled}
max={this.max}
min={this.min}
Expand Down