Skip to content

Commit

Permalink
Merge pull request #25624 from samh-nl/fix/issue-23933
Browse files Browse the repository at this point in the history
fix: use stripped amount for new selection
  • Loading branch information
danieldoglas authored Aug 24, 2023
2 parents ef53336 + 78d8b20 commit ed859eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
return;
}
setCurrentAmount((prevAmount) => {
setSelection((prevSelection) => getNewSelection(prevSelection, prevAmount.length, newAmountWithoutSpaces.length));
return MoneyRequestUtils.stripCommaFromAmount(newAmountWithoutSpaces);
const strippedAmount = MoneyRequestUtils.stripCommaFromAmount(newAmountWithoutSpaces);
setSelection((prevSelection) => getNewSelection(prevSelection, prevAmount.length, strippedAmount.length));
return strippedAmount;
});
};

Expand Down

0 comments on commit ed859eb

Please sign in to comment.