From 7a3de3e093f5dcd0e7b95e3ff6325f62e18921dc Mon Sep 17 00:00:00 2001 From: melloware Date: Mon, 8 Apr 2024 15:01:44 -0400 Subject: [PATCH] Fix #6275: InputNumber restore Android usage --- components/lib/inputnumber/InputNumber.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index 53546e2872..504c98ea5c 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -316,6 +316,10 @@ export const InputNumber = React.memo( } isSpecialChar.current = false; + + if (!DomHandler.isAndroid()) { + return; + } }; const onInputKeyDown = (event) => { @@ -323,7 +327,7 @@ export const InputNumber = React.memo( return; } - if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) { + if (event.altKey || event.ctrlKey || event.metaKey) { isSpecialChar.current = true; return; @@ -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; @@ -430,7 +439,6 @@ export const InputNumber = React.memo( newValueStr = deleteRange(inputValue, selectionStart, selectionEnd); updateValue(event, newValueStr, null, 'delete-range'); } - break; // del