Skip to content

Commit 541ba8a

Browse files
authored
fix #8274 : InputNumber setting value doesn't trigger onChange (#8275)
* fix #8274 : InputNumber setting value doesn't trigger onChange * style: format code (#8274)
1 parent 754439d commit 541ba8a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

components/lib/inputnumber/InputNumber.js

Lines changed: 4 additions & 1 deletion
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);
11411143

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

0 commit comments

Comments
 (0)