App icon indicating copy to clipboard operation
App copied to clipboard

Use left/right arrow keys to move cursor in IOUAmountPage

Open rushatgabhane opened this issue 5 years ago • 12 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Request money to any user.
  2. Enter an amount.
  3. Use left/right arrow key to move the cursor.

Expected Result:

The cursor on the amount should move with left/right arrow key press.

Actual Result:

Arrow keys don't move the cursor. image

Workaround:

Use backspace key to modify amount.

Platform:

Where is this issue occurring?

Web ✔ iOS Android Desktop App ✔ Mobile Web

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:

View all open jobs on Upwork

rushatgabhane avatar Jun 28 '21 16:06 rushatgabhane

Triggered auto assignment to @conorpendergrast (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Jun 28 '21 16:06 MelvinBot

Proposal

Replace onKeyPress prop with onChangeText prop to handle amount changed.

onChangeText={(amount) => {
     // Regex to validate decimal number with up to 3 decimal numbers
    const decimalNumberRegex = new RegExp(/^\d+(\.\d{0,3})?$/, 'i');
    if (amount != '' && !decimalNumberRegex.test(amount)) {
        return;
    }
    this.setState({amount});
}}

https://github.com/Expensify/Expensify.cash/blob/a1c742c194084b6b65c3f29225d25d3cfe08cce4/src/pages/iou/steps/IOUAmountPage.js#L162-L172

Works fine on initial testing.

https://user-images.githubusercontent.com/29673073/123718463-d921fd00-d887-11eb-80aa-4faa90d47b5d.mp4

rushatgabhane avatar Jun 29 '21 00:06 rushatgabhane

Reproduced, agreed that this is worth fixing. I don't have a comment on the proposed solution here - moving to Engineering for triage!

conorpendergrast avatar Jun 29 '21 15:06 conorpendergrast

Triggered auto assignment to @TomatoToaster (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Jun 29 '21 15:06 MelvinBot

Feels like a classic external ticket to me.

TomatoToaster avatar Jun 29 '21 15:06 TomatoToaster

Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Jun 29 '21 15:06 MelvinBot

Posted: https://www.upwork.com/jobs/~01a3bdaa0904a69a95

jliexpensify avatar Jun 30 '21 01:06 jliexpensify

Triggered auto assignment to @roryabraham (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Jun 30 '21 01:06 MelvinBot

@roryabraham - got a proposal from @rushatgabhane already, if you could take a look. Cheers!

jliexpensify avatar Jun 30 '21 01:06 jliexpensify

Solution seems perfectly reasonable to me @rushatgabhane!

@jliexpensify let's get @rushatgabhane hired on Upwork.

@rushatgabhane feel free to submit a pull request as soon as you've been hired on Upwork. Since I reviewed the proposal, please request a review from me when you submit the pull request. Thanks!

roryabraham avatar Jul 01 '21 04:07 roryabraham

Hired @rushatgabhane - cheers!

jliexpensify avatar Jul 01 '21 04:07 jliexpensify

Deployed, and paid @rushatgabhane - thanks!

jliexpensify avatar Jul 09 '21 05:07 jliexpensify