Skip to content

Commit

Permalink
Merge pull request Expensify#16825 from ahmedGaber93/fix-cursor-move-…
Browse files Browse the repository at this point in the history
…to-end-when-max-length-reached-web

fix cursor move to end when max length reached
  • Loading branch information
AndrewGable authored Apr 8, 2023
2 parents ba36250 + 0f57d1a commit 3ec5297
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class IOUAmountPage extends React.Component {
*/
getNewState(prevState, newAmount) {
if (!this.validateAmount(newAmount)) {
return prevState;
// Use a shallow copy of selection to trigger setSelection
// More info: https://github.com/Expensify/App/issues/16385
return {amount: prevState.amount, selection: {...prevState.selection}};
}
const selection = this.getNewSelection(prevState.selection, prevState.amount.length, newAmount.length);
return {amount: this.stripCommaFromAmount(newAmount), selection};
Expand Down

0 comments on commit 3ec5297

Please sign in to comment.