Skip to content

[Pay meow][$250] Web - Composer - Cursor positioned at the start if pasting text which contains a new line #42216

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.74-0
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Open a chat and type a one line text and create an empty new line
  3. Select all using keyboard ctrl + A and cut the text
  4. Paste it inside the compose box

Expected Result:

The cursor gets positioned at the end of the pasted text, no console error

Actual Result:

The cursor gets positioned at the start of the pasted text if the pasted text contains a new empty line, console error is showing

Workaround:

n/a

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

Bug6481716_1715782332852.bandicam_2024-05-15_17-07-29-894.mp4
image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cc45b59ee9c4ae02
  • Upwork Job ID: 1792451156946927616
  • Last Price Increase: 2024-08-08

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 15, 2024
  2. melvin-bot commented on May 15, 2024

    @melvin-bot

    Triggered auto assignment to @Christinadobrzyn (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.

  3. kbecciv commented on May 15, 2024

    @kbecciv
    Author

    We think that this bug might be related to #wave-collect - Release 1

  4. kbecciv commented on May 15, 2024

    @kbecciv
    Author

    @Christinadobrzyn FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

  5. Christinadobrzyn commented on May 16, 2024

    @Christinadobrzyn
    Contributor

    Very similar to #42112 - asking if the fix will be the same

  6. MOONSTAR-TOP-DEV commented on May 16, 2024

    @MOONSTAR-TOP-DEV
    Contributor

    Proposal

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

    Web - Composer - Cursor positioned at the start if pasting text which contains a new line

    What is the root cause of that problem?

    We are setting cursor position in below part when pasting.

    range.setStart(node, node.length);
    range.setEnd(node, node.length);

    When pasted text contains empty line, the value of node.length is greater than it's actually length because the length of line break at the end(\n\n) will be caculated as 2.
    So console error occurs and cursor is not set because we are trying to set cursor to non-exist position.

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

    We have to set range with node.length - 1 when it contains empty line at the end.

    What alternative solutions did you explore? (Optional)

  7. melvin-bot commented on May 16, 2024

    @melvin-bot

    📣 @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>
    
  8. Christinadobrzyn commented on May 20, 2024

    @Christinadobrzyn
    Contributor

    Doesn't seem to be related to #42112 as that is resolved. I can still reproduce this - adding external

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 20, 2024
  10. changed the title [-]Web - Composer - Cursor positioned at the start if pasting text which contains a new line[/-] [+][$250] Web - Composer - Cursor positioned at the start if pasting text which contains a new line[/+] on May 20, 2024
  11. melvin-bot commented on May 20, 2024

    @melvin-bot
  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 20, 2024
  13. 82 remaining items

  14. mallenexpensify commented on Aug 19, 2024

    @mallenexpensify
    Contributor

    The decision to compensate @rakhaxor is an edge case, based on the fact they were assigned to the issue and hired. It was the responsibility of Expensify to hire/assign. Since this action is considered a source-of-truth and gives the green light for the contributor to invest more time into the issue (assuming compensation), we feel it's fair to compensate. Since their proposal was initially accepted, we decided on 50%.

    @moonstar-95515 , your compensation on this issue, and the value associated with it, is completely unrelated to the compensation for @rakhaxor. Please keep in mind our documented code of conduct when communicating with others, both internal and with fellow contributors.

    We pride ourselves as a company and as individual employees on our core qualities: Talent, Ambition, & Humility. The environment we have developed uses these qualities to adhere to our two golden rules of Expensify:

    1. Get Shit Done
    2. Don’t Ruin it for Everyone Else

    Thanks

  15. melvin-bot commented on Aug 19, 2024

    @melvin-bot

    @AndrewGable, @eVoloshchak, @rakhaxor, @Christinadobrzyn, @moonstar-95515 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. Christinadobrzyn commented on Aug 19, 2024

    @Christinadobrzyn
    Contributor

    Quick follow up - based on a review (as Matt outlined) we are going to continue with this payment summary.

    @eVoloshchak can you accept this Upwork offer - https://www.upwork.com/nx/wm/offer/103544327
    @rakhaxor can you accept this Upwork offer - https://www.upwork.com/nx/wm/offer/103593092

    TY!

  17. rakhaxor commented on Aug 20, 2024

    @rakhaxor

    Hello @Christinadobrzyn! I have accepted the offer on Upwork. Thank you

  18. eVoloshchak commented on Aug 20, 2024

    @eVoloshchak
    Contributor

    @Christinadobrzyn, declined the Upwork offer, requested the payment on NewDot
    Thanks!

  19. Christinadobrzyn commented on Aug 20, 2024

    @Christinadobrzyn
    Contributor

    Awesome! Thanks! The payment summary is here.

    Feel free to submit your NewDot payment @eVoloshchak. Also, I don't see that it was asked but do we need a regression test for this?

  20. JmillsExpensify commented on Aug 20, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @eVoloshchak

  21. Christinadobrzyn commented on Aug 20, 2024

    @Christinadobrzyn
    Contributor

    @eVoloshchak can you let us know about a regression test? Then I think this is good to close!

  22. eVoloshchak commented on Aug 21, 2024

    @eVoloshchak
    Contributor

    Yes, a regression test would be useful and easy to perform

    Regression Test Proposal

    1. Navigate to staging.new.expensify.com
    2. Open a chat and type a one-line text and create a few empty lines
    test
    
    
    
    
    1. Select all using keyboard ctrl + A and cut the text
    2. Paste it inside the composer
    3. Verify the cursor is positioned at the end of the pasted text

    Do we agree 👍 or 👎

  23. Christinadobrzyn commented on Aug 21, 2024

    @Christinadobrzyn
    Contributor
  24. melvin-bot commented on Aug 21, 2024

    @melvin-bot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions