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] Expense, task, room - Unable to create a new line in description field with SHIFT+Enter #49374

Closed
3 of 6 tasks
IuliiaHerets opened this issue Sep 18, 2024 · 37 comments
Closed
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 18, 2024

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: 9.0.37-0
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to chat.
  3. Click + > Submit expense > Manual.
  4. Enter amount > Next.
  5. Click Description.
  6. Press SHIFT+ENTER (enter key for mweb).

Expected Result:

A new line will be created with SHIFT+ENTER.

Actual Result:

A new line is not created with SHIFT+ENTER. The description is saved instead.

This issue happens in IOU, task and room description.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6607157_1726619223526.20240918_082254.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836355229392782754
  • Upwork Job ID: 1836355229392782754
  • Last Price Increase: 2024-09-18
  • Automatic offers:
    • DylanDylann | Reviewer | 104086887
    • nkdengineer | Contributor | 104086888
Issue OwnerCurrent Issue Owner: @DylanDylann
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 18, 2024
Copy link

melvin-bot bot commented Sep 18, 2024

Triggered auto assignment to @cead22 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Sep 18, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 18, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 18, 2024
@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-control

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@etCoderDysto
Copy link
Contributor

This might have the same RCA with #49368

@cead22 cead22 added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 18, 2024
@nkdengineer
Copy link
Contributor

I think the RCA is not the same.

@cead22
Copy link
Contributor

cead22 commented Sep 18, 2024

Thanks @etCoderDysto. Can you check if you can reproduce this using the branch for this PR #49370?

@cead22
Copy link
Contributor

cead22 commented Sep 18, 2024

I don't think this needs to block the deploy

@etCoderDysto
Copy link
Contributor

Thanks @etCoderDysto. Can you check if you can reproduce this using the branch for this PR #49370?

Sure! I am checking now...

@etCoderDysto
Copy link
Contributor

@cead22 I am able to reproduce the issue on this branch #49370. The issues are not related.

Screen.Recording.2024-09-18.at.1.03.47.in.the.afternoon.mp4

@cead22
Copy link
Contributor

cead22 commented Sep 18, 2024

Thank you! Feel free to submit a proposal

@cead22 cead22 added the External Added to denote the issue can be worked on by a contributor label Sep 18, 2024
Copy link

melvin-bot bot commented Sep 18, 2024

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

@melvin-bot melvin-bot bot changed the title Expense, task, room - Unable to create a new line in description field with SHIFT+Enter [$250] Expense, task, room - Unable to create a new line in description field with SHIFT+Enter Sep 18, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 18, 2024
Copy link

melvin-bot bot commented Sep 18, 2024

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

@DylanDylann
Copy link
Contributor

Anyways, I see the original bug still happen

Screen.Recording.2024-09-18.at.21.05.02.mov

@luacmartins
Copy link
Contributor

Oh weird, I'm seeing the issue again but now it navigates back @Skalakid since you worked on the PR.

@nkdengineer
Copy link
Contributor

Proposal

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

A new line is not created with SHIFT+ENTER. The description is saved instead.

What is the root cause of that problem?

The markdown input is a div component with role textarea

Screenshot 2024-09-19 at 12 58 08

Then shouldDisableEnterShortcut is false

const shouldDisableEnterShortcut = useMemo(() => accessibilityRoles.includes(activeElementRole ?? '') && activeElementRole !== CONST.ROLE.PRESENTATION, [activeElementRole]);

and this check is passed because the nodeName is DIV

const eventTarget = event?.target as HTMLElement;
if (isDisabled || isLoading || eventTarget.nodeName === 'TEXTAREA') {
return false;
}

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

We can add TEXTAREA role to CONST.ROLE

Or we can return false here if the eventTarget.role is textarea

if (isDisabled || isLoading || eventTarget.nodeName === 'TEXTAREA' || eventTarget.role === 'textarea') {
    return false;
}

const eventTarget = event?.target as HTMLElement;
if (isDisabled || isLoading || eventTarget.nodeName === 'TEXTAREA') {
return false;
}

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 19, 2024
@Skalakid
Copy link
Contributor

Oh, okay, my PR fixed the issue inside the main chat Composer and all other inputs that appear on the main panel. Inputs in task, expense, and room pages are still broken

@Skalakid
Copy link
Contributor

Skalakid commented Sep 19, 2024

@nkdengineer, thanks for the proposal, to make it work, we should change the condition to eventTarget.role === 'textbox'. textarea role isn't applied for this eventTarget in the task page. However, I think putting the condition eventTarget?.contentEditable would be better because it's more generic and will work with any contentEditable element, not just Live Markdown Input. @DylanDylann @luacmartins what do you think about it?

if (isDisabled || isLoading || eventTarget.nodeName === 'TEXTAREA' || eventTarget?.contentEditable) {
    return false;
}

@nkdengineer
Copy link
Contributor

thanks for the proposal, to make it work, we should change the condition to eventTarget.role === 'textbox'

@Skalakid Thanks for your feedback, this is the result when I log the eventTarget.role here for markdown input.

const eventTarget = event?.target as HTMLElement;

Screen.Recording.2024-09-19.at.15.20.37.mov

However, I think putting the condition eventTarget?.contentEditable would be better because it's more generic and will
work with any contentEditable element, not just Live Markdown Input

Checking eventTarget?.contentEditable may be incorrect, for example in the image below, I logged the contentEditable of a normal TextInput and if it still exists then that will prevent the enter to submitting the form if we're focusing on a single line input. Instead, I think we can check eventTarget.ariaMultiLine or (eventTarget?.contentEditable && eventTarget.ariaMultiLine

@Skalakid
Copy link
Contributor

Skalakid commented Sep 19, 2024

@nkdengineer Oh okay so we can just add eventTarget?.contentEditable === 'true' and it will work with TextInput components as well

@nkdengineer
Copy link
Contributor

@Skalakid I think that is also an idea.

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 19, 2024

IMO both ways look fine 😄:

  1. Using eventTarget.ariaMultiLine
  2. Using eventTarget?.contentEditable === 'true'

@luacmartins Who will take care of this issue next? 😄 I think we can go with @nkdengineer's proposal

@miljakljajic miljakljajic removed their assignment Sep 20, 2024
@miljakljajic miljakljajic added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

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

@miljakljajic
Copy link
Contributor

@slafortune thank you for taking this one over as I start my parental leave.

@luacmartins @cead22 will we be going with @nkdengineer 's proposal? Stevie can get them assigned and take this one forward

@DylanDylann
Copy link
Contributor

@luacmartins @cead22 Could you please check my comment ?

@cead22
Copy link
Contributor

cead22 commented Sep 23, 2024

Both work from my perspective, so I'd lean on what you @DylanDylann and @luacmartins think is best

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Sep 23, 2024

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@DylanDylann
Copy link
Contributor

@slafortune This is ready for payment. The PR is deployed to production on 1/10

@slafortune
Copy link
Contributor

@DylanDylann role - contributor - Paid $250 via upworks
@nkdengineer Role - C+ - Paid $250 via upworks

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants