Skip to content

Commit 0b56bf8

Browse files
committed
fix #8274 : InputNumber setting value doesn't trigger onChange
1 parent 754439d commit 0b56bf8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

components/lib/inputnumber/InputNumber.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,12 +1135,15 @@ export const InputNumber = React.memo(
11351135
const changeValue = () => {
11361136
const val = validateValueByLimit(props.value);
11371137

1138+
const currentValue = inputRef.current.value;
1139+
11381140
updateInputValue(props.format ? val : replaceDecimalSeparator(val));
11391141

11401142
const newValue = validateValue(props.value);
1141-
1142-
if (props.value !== null && props.value !== newValue) {
1143+
1144+
if (props.value !== null && currentValue !== newValue) {
11431145
updateModel(null, newValue);
1146+
handleOnChange(null, currentValue, newValue);
11441147
}
11451148
};
11461149

0 commit comments

Comments
 (0)