diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index cad34e7c5c..e73cc328a7 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -853,10 +853,14 @@ export const InputNumber = React.memo( selectionEnd = sRegex.lastIndex + tRegex.lastIndex; inputEl.setSelectionRange(selectionEnd, selectionEnd); } else if (newLength === currentLength) { - if (['insert', 'delete-back-single', 'delete-range', 'spin'].includes(operation)) { - inputEl.setSelectionRange(selectionEnd, selectionEnd); + if (operation === 'insert' || operation === 'delete-back-single') { + const newSelectionEnd = selectionEnd + Number(isDecimalSign(value) || isDecimalSign(insertedValueStr)); + + inputEl.setSelectionRange(newSelectionEnd, newSelectionEnd); } else if (operation === 'delete-single') { inputEl.setSelectionRange(selectionEnd - 1, selectionEnd - 1); + } else if (operation === 'delete-range' || operation === 'spin') { + inputEl.setSelectionRange(selectionEnd, selectionEnd); } } else if (operation === 'delete-back-single') { let prevChar = inputValue.charAt(selectionEnd - 1);