Skip to content

[HOLD #27977][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box #35369

Closed

Description

@kavimuru

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: v1.4.33-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: Applause internal team
Slack conversation:

Action Performed:

Pre-requisite: user must be logged in.

  1. Go to any chat.
  2. Tap on the compose box.
  3. Tap on Enter until you have entered more than 6 lines.

Expected Result:

The cursor should be displayed no matter how many lines are being entered.

Actual Result:

The cursor disappears after more than 6 lines have been entered.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

Bug6360353_1706581410106.Ryzu6837_1_.mp4

View all open jobs on GitHub

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

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 30, 2024
  2. changed the title [-]Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-] [+][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+] on Jan 30, 2024
  3. melvin-bot commented on Jan 30, 2024

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  4. melvin-bot commented on Jan 30, 2024

    @melvin-bot
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 30, 2024
  6. melvin-bot commented on Jan 30, 2024

    @melvin-bot

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

  7. melvin-bot commented on Jan 30, 2024

    @melvin-bot

    📣 @rayanetech! 📣
    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. aswin-s commented on Jan 31, 2024

    @aswin-s
    Contributor

    Proposal

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

    Cursor goes out of view after adding more than 6 lines

    What is the root cause of that problem?

    For small screen devices, the max number of lines for Composer input is set to 6 lines. On mobile safari beyond this height overflow scroll behaviour sets in. So even though the scroll height of TextArea increases the visible area of the TextArea is limited to 6 lines. So cursor moves beyond the visible area when new line is entered beyond 6 lines. That's the reason cursor gets hidden.

    However when user enters any other character the scroll position is reset to the cursor position making the cursor visible again.

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

    The scroll position of the Composer TextArea should be set to the cursor position at all times, even when the character entered is a new line. To acheive this we already have a hook updateMultilineInputRange that sets scrollTop to current scroll height of input. But for ComposerWithSuggestion it gets invoked only on mount as the dependency array of useEffect hook is set to [].

    useEffect(() => {
    // Scrolls the composer to the bottom and sets the selection to the end, so that longer drafts are easier to edit
    updateMultilineInputRange(textInputRef.current, shouldAutoFocus);
    if (value.length === 0) {
    return;
    }
    Report.setReportWithDraft(reportID, true);
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, []);

    Instead add value to dependency array so that the scroll position is set whenever value changes. This ensures that scroll position is maintained even when new line is entered.

    useEffect(() => {
      // Scrolls the composer to the bottom and sets the selection to the end, so that longer drafts are easier to edit
      updateMultilineInputRange(textInputRef.current, shouldAutoFocus);
    
      if (value.length === 0) {
        return;
      }
    
      Report.setReportWithDraft(reportID, true);
      
      // Add value as a dependency so that the hook runs on value change
      // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [value]); 

    Result

    Before After
    before.mp4
    fix.mp4

    What alternative solutions did you explore? (Optional)

    None

  9. melvin-bot commented on Feb 2, 2024

    @melvin-bot

    @garrettmknight, @mananjadhav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  10. mananjadhav commented on Feb 2, 2024

    @mananjadhav
    Collaborator

    @aswin-s's proposal seems to be working. I can see both the videos are iOS native, @aswin-s but the header says Web on the right.

    🎀 👀 🎀 C+ Reviewed.

  11. 13 remaining items

  12. changed the title [-][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-] [+][HOLD][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+] on Feb 8, 2024
  13. mananjadhav commented on Feb 8, 2024

    @mananjadhav
    Collaborator

    @danieldoglas @thienlnam Do we have any PR or issue that we can link against?

  14. danieldoglas commented on Feb 8, 2024

    @danieldoglas
    Contributor

    The web implementation was merged yesterday in the react-live-markdown repo Expensify/react-native-live-markdown#32, and it looks like it's making it's way to web here #35837

  15. thienlnam commented on Feb 8, 2024

    @thienlnam
    Contributor

    Live markdown web has been merged!

  16. mananjadhav commented on Feb 12, 2024

    @mananjadhav
    Collaborator

    @kavimuru Is this still reproducible?

  17. thienlnam commented on Feb 12, 2024

    @thienlnam
    Contributor

    We actually ended up reverted the PR, but I'm going to update the issue it's held on so we can wait until then

  18. changed the title [-][HOLD][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-] [+][HOLD #27977][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+] on Feb 12, 2024
  19. danieldoglas commented on Feb 20, 2024

    @danieldoglas
    Contributor

    still on hold

  20. garrettmknight commented on Feb 28, 2024

    @garrettmknight
    Contributor

    Still holding on #279877

  21. garrettmknight commented on Mar 5, 2024

    @garrettmknight
    Contributor

    Looks like it's fixed, closing!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions