diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index 33a7abb9b7..dcb5c31a91 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -313,9 +313,19 @@ export const InputNumber = React.memo( if (isSpecialChar.current) { event.target.value = lastValue.current; + isSpecialChar.current = false; } - isSpecialChar.current = false; + if (DomHandler.isAndroid()) { + return; + } + + // #6324 Chrome is allowing accent-dead characters through... + const inputType = event.nativeEvent.inputType; + const data = event.nativeEvent.data; + if (inputType === 'insertText' && /\D/.test(data)) { + event.target.value = lastValue.current; + } }; const onInputAndroidKey = (event) => { @@ -531,6 +541,7 @@ export const InputNumber = React.memo( default: event.preventDefault(); + event.stopPropagation(); let char = event.key; const _isDecimalSign = isDecimalSign(char);