From 8b74fd68edd1f98b1ff61c7562ef5ca69b7fc0fa Mon Sep 17 00:00:00 2001 From: ORAZIO SPADA Date: Sat, 22 Nov 2025 15:56:57 +0100 Subject: [PATCH] fix: resolve react-number-format compatibility by refining compositionEnd handling --- src/Input.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Input.tsx b/src/Input.tsx index 866b211..f6e871e 100644 --- a/src/Input.tsx +++ b/src/Input.tsx @@ -117,14 +117,15 @@ const Input = forwardRef((props, ref) => { inputRef.current?.selectionEnd || 0, ]); } - } else if (info.source === 'compositionEnd') { - // Avoid triggering twice - // https://github.com/ant-design/ant-design/issues/46587 - return; } + + // Always update the value state setValue(cutValue); - if (inputRef.current) { + // Only trigger onChange if value has actually changed + // This prevents double-firing (issue #46587) while still allowing + // external wrappers like react-number-format to work (issue #46999) + if (inputRef.current && cutValue !== formatValue) { resolveOnChange(inputRef.current, e, onChange, cutValue); } };