Skip to content

Commit

Permalink
Fix #6275: InputNumber restore Android usage
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 8, 2024
1 parent 131e680 commit 7a3de3e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,18 @@ export const InputNumber = React.memo(
}

isSpecialChar.current = false;

if (!DomHandler.isAndroid()) {
return;
}
};

const onInputKeyDown = (event) => {
if (props.disabled || props.readOnly) {
return;
}

if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
if (event.altKey || event.ctrlKey || event.metaKey) {
isSpecialChar.current = true;

return;
Expand All @@ -340,6 +344,11 @@ export const InputNumber = React.memo(

lastValue.current = event.target.value;

// Android is handled specially in onInput
if (DomHandler.isAndroid()) {
return;
}

let selectionStart = event.target.selectionStart;
let selectionEnd = event.target.selectionEnd;
let inputValue = event.target.value;
Expand Down Expand Up @@ -430,7 +439,6 @@ export const InputNumber = React.memo(
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
updateValue(event, newValueStr, null, 'delete-range');
}

break;

// del
Expand Down

0 comments on commit 7a3de3e

Please sign in to comment.