Skip to content

Commit

Permalink
Fix #6324: InputNumber allowing accent/dead characters (#6352)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Apr 29, 2024
1 parent e2c77da commit 0830867
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 0830867

Please sign in to comment.