Skip to content

Commit

Permalink
Merge pull request #6566 from ujshaikh/PR6522
Browse files Browse the repository at this point in the history
Fix #6522: Minus sign after all selection - InputNumber
  • Loading branch information
nitrogenous committed May 13, 2024
2 parents 697d476 + b3089bb commit fb18a93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,8 @@ export const InputNumber = React.memo(
if (sign.isMinusSign) {
const isNewMinusSign = minusCharIndex === -1;

if (isNewMinusSign && (selectionStart === 0 || selectionStart === currencyCharIndex + 1)) {
// #6522 - Selected negative value can't be overwritten with a minus ('-') symbol
if (selectionStart === 0 || selectionStart === currencyCharIndex + 1) {
newValueStr = inputValue;

if (isNewMinusSign || selectionEnd !== 0) {
Expand Down

0 comments on commit fb18a93

Please sign in to comment.