Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Cursor is misplaced after pasting a multiline message on Description field in request Money flow. #42112

Closed
1 of 6 tasks
m-natarajan opened this issue May 13, 2024 · 16 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@m-natarajan
Copy link

m-natarajan commented May 13, 2024

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


Version Number: 1.4.73-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @parasharrajat
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1715584445797959

Action Performed:

  1. Create a new money request via Submit expense.
  2. Enter amount and go to confirmation page.
  3. Click Description Now paste a multiple text.
  4. Observe the cursor after text is pasted.

Expected Result:

Cursor should be at the end of pasted text.

Actual Result:

Cursor is at the second last character of the pasted text.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Recording.51.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b95c1756beba7a4b
  • Upwork Job ID: 1790840678415347712
  • Last Price Increase: 2024-05-22
Issue OwnerCurrent Issue Owner: @rushatgabhane
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label May 15, 2024
@melvin-bot melvin-bot bot changed the title Cursor is misplaced after pasting a multiline message on Description field in request Money flow. [$250] Cursor is misplaced after pasting a multiline message on Description field in request Money flow. May 15, 2024
Copy link

melvin-bot bot commented May 15, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01b95c1756beba7a4b

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 15, 2024
Copy link

melvin-bot bot commented May 15, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

@alexrasla
Copy link

alexrasla commented May 15, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

The cursor in the description field of the Submit expense model does not render at the end of the input text when we paste multiple lines

What is the root cause of that problem?

The root cause of the problem is that we are treating the input field as an HTML input element, when it is really a content-editable div`

What changes do you think we should make in order to solve the problem?

We need to check whether the input variable passed in updateMultilineInputRange is a input HTML element, or a content-editable div. If it is a input element, use the same functionality we have now, but if it is a content-editable div, we want to utilize the document.createRange and window.getSelection functions to move the cursor to the end of the content-editable div value. This is a solution that works with content-editable divs, and will be further optimized if my proposal is selected:

if (shouldAutoFocus && document.createRange && window.getSelection) {
        const range = document.createRange();
        range.selectNodeContents(input);
        range.collapse(false); // false means collapse to end (true would be collapse to start)
        const selection = window.getSelection();
        if (selection) {
            selection.removeAllRanges();
            selection.addRange(range);
        }
        // eslint-disable-next-line no-param-reassign
        input.scrollTop = input.scrollHeight;
    }

@Christinadobrzyn
Copy link
Contributor

Hey @rushatgabhane do you think this issue has the same root? Can they be fixed together?

@MOONSTAR-TOP-DEV
Copy link
Contributor

I can't reproduce on staging.

Copy link

melvin-bot bot commented May 17, 2024

📣 @moonstar-95515! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@parasharrajat
Copy link
Member

Use following steps:

  1. On the description page.
  2. Write Github issue.
  3. Then copy the title of any issue from GitHub like this one and paste it in the field.
  4. Notice the cursor.

@melvin-bot melvin-bot bot added the Overdue label May 18, 2024
@MOONSTAR-TOP-DEV
Copy link
Contributor

@parasharrajat
Still can't reproduce it.

Then copy the title of any issue from GitHub like this one and paste it in the field.

Could you please add example GitHub issue title?

@parasharrajat
Copy link
Member

Looks like this is fixed. I can't reproduce on staging.

@rushatgabhane
Copy link
Member

rushatgabhane commented May 20, 2024

agree, can't repro this issue on staging

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@johncschuster
Copy link
Contributor

Great! Thanks for confirming that! Can we close this one?

@rushatgabhane
Copy link
Member

@johncschuster yes

Copy link

melvin-bot bot commented May 22, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented May 27, 2024

@johncschuster @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label May 27, 2024
Copy link

melvin-bot bot commented May 27, 2024

@johncschuster, @rushatgabhane Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot removed the Overdue label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants