From 0b56bf83dfeb7456ed73b124395e571da960ff16 Mon Sep 17 00:00:00 2001 From: tanerengiiin Date: Wed, 10 Sep 2025 15:56:48 +0300 Subject: [PATCH 1/2] fix #8274 : InputNumber setting value doesn't trigger onChange --- components/lib/inputnumber/InputNumber.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index dcdc598cbc..0bc1ef9eb0 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -1135,12 +1135,15 @@ export const InputNumber = React.memo( const changeValue = () => { const val = validateValueByLimit(props.value); + const currentValue = inputRef.current.value; + updateInputValue(props.format ? val : replaceDecimalSeparator(val)); const newValue = validateValue(props.value); - - if (props.value !== null && props.value !== newValue) { + + if (props.value !== null && currentValue !== newValue) { updateModel(null, newValue); + handleOnChange(null, currentValue, newValue); } }; From e0f0cfd90210c2aaa40cdc7650c6199bac54e7f2 Mon Sep 17 00:00:00 2001 From: tanerengiiin Date: Wed, 10 Sep 2025 16:04:52 +0300 Subject: [PATCH 2/2] style: format code (#8274) --- components/lib/inputnumber/InputNumber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index 0bc1ef9eb0..c638dc012b 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -1140,7 +1140,7 @@ export const InputNumber = React.memo( updateInputValue(props.format ? val : replaceDecimalSeparator(val)); const newValue = validateValue(props.value); - + if (props.value !== null && currentValue !== newValue) { updateModel(null, newValue); handleOnChange(null, currentValue, newValue);