Skip to content

Commit

Permalink
add additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedGaber93 committed Apr 3, 2023
1 parent a07e4c4 commit 0f57d1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ class IOUAmountPage extends React.Component {
*/
getNewState(prevState, newAmount) {
if (!this.validateAmount(newAmount)) {
// return prevState with shallow copy of selection object
// to set the cursor in the same position if move to end after maxLength reach.
return {...prevState, selection: {...prevState.selection}};
// 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 0f57d1a

Please sign in to comment.