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

Web - Unable to type when popover is open from emoji reaction #27250

Closed
1 of 6 tasks
kbecciv opened this issue Sep 12, 2023 · 28 comments
Closed
1 of 6 tasks

Web - Unable to type when popover is open from emoji reaction #27250

kbecciv opened this issue Sep 12, 2023 · 28 comments
Assignees

Comments

@kbecciv
Copy link

kbecciv commented Sep 12, 2023

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


Action Performed:

  1. Open the website
  2. Open any chat from LHN
  3. Send a message (it can be a text)
  4. React an emoji for a message
  5. Open popover from emoji reaction by clicking right-click
  6. Start typing
  7. Observe the result

Expected Result:

It should be able to type in the composer when a popover is open from an emoji reaction.

Actual Result:

Unable to type in the composer when the popover is open from emoji reaction

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.68.12
Reproducible in staging?: y
Reproducible in production?: n
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
Notes/Photos/Videos: Any additional supporting documentation

Screenshare.-.2023-09-12.2_12_09.PM.1.mp4
2023-09-12.15.35.43.mov

Expensify/Expensify Issue URL:
Issue reported by: @misgana96
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694508014533939

View all open jobs on GitHub

@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Sep 12, 2023
@OSBotify
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.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@jscardona12
Copy link
Contributor

Can't reproduce on dev

@paultsimura
Copy link
Contributor

paultsimura commented Sep 12, 2023

Proposal

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

On right-click on the emoji reaction, the input field loses focus.

What is the root cause of that problem?

The text input blurs when the emoji bubble is right-clicked:

onMouseDown={(e) => {
// Allow text input blur when emoji reaction is right clicked
if (e && e.button === 2) {
return;
}
// Prevent text input blur when emoji reaction is left clicked
e.preventDefault();
}}

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

Remove the right-click check in the onMouseDown function of EmojiReactionBubble:

            onMouseDown={(e) => {
-               // Allow text input blur when emoji reaction is right clicked
-               if (e && e.button === 2) {
-                  return;
-               }
-
                // Prevent text input blur when emoji reaction is left clicked
                e.preventDefault();
            }}

However, this was done by intention some time ago in this PR: #22107. Therefore, it's better to double-check if it's not an expected behavior.

What alternative solutions did you explore? (Optional)

@dangrous
Copy link
Contributor

Yeah with that comment there it really feels like expected behavior - I'm syncing with the team to confirm but I think we'll be able to close this out.

@misgana96
Copy link

I think typing in the composer when popover is open from emoji reaction is expected behaviour

@dangrous
Copy link
Contributor

Due to #26826

@aimane-chnaif
Copy link
Contributor

I think this is not a blocker and can be tackled together in #25485.
@dangrous can you please check #25485 (comment) and confirm the expected behavior?

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

I'm not able re-produce this popover, how to enable this type of popup for reactions?

I think when a popover is opened user should not be able to type.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

I have disabled it because, I was able to type in composer even when Attachment popup is opened, call option menu is also opened.

@dangrous
Copy link
Contributor

discussing in Slack here to figure out expected behavior

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

Also @aimane-chnaif I don't think it possible to have focus when a popover is opened. We remove focus from composer when a popover/modal so I think the expected behaviour is user shouldn't have any power to type when any modal is opened.

@aimane-chnaif
Copy link
Contributor

@b4s36t4 here's production app behavior:

Screen.Recording.2023-09-12.at.6.29.48.PM.mov

So it's intentional not to blur composer when non-modal popover is open

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

I think this is the only place we keep composer focused, in all other places like even for emoji popup we remove focus.

@aimane-chnaif
Copy link
Contributor

I think this is the only place we keep composer focused, in all other places like even for emoji popup we remove focus.

#25485 is to fix that inconsistency

@aimane-chnaif
Copy link
Contributor

Also, it's possible to focus on composer when emoji popup is open in production app, which is this GH

Screen.Recording.2023-09-12.at.6.35.39.PM.mov

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

in my view weather if we have any popup opened we should never focus the composer.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

it doesn't make any sense to allow few popups (this GH & and other issue) & doesn't allow few popups (call popover, attachment popover).

@aimane-chnaif
Copy link
Contributor

@b4s36t4 that's the difference between non-modal and modal

Attachment, RHP are modals while emoji popup, LHN menu are non-modals

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

Screenshot 2023-09-12 at 11 21 43 PM Screenshot 2023-09-12 at 11 21 39 PM

I don't think these two are modals.

@aimane-chnaif
Copy link
Contributor

Screenshot 2023-09-12 at 11 21 43 PM Screenshot 2023-09-12 at 11 21 39 PM
I don't think these two are modals.

Those are non-modals of course. When you type something, you will notice that composer is focused in production app.

The issue what you fixed should have touched only modals, not non-modals

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

The Root cause of that issue is also non-modals. I thought my PR would raise a regression so I updated that condition as well.

Those are non-modals of course. When you type something, you will notice that composer is focused in production app.

This is bug right?

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

This is bug right?

if that is expected, I touched it unknowingly which caused the regression.

@aimane-chnaif
Copy link
Contributor

discussing in Slack here to figure out expected behavior

Let's wait for feedback

@dangrous
Copy link
Contributor

Okay so we're gonna remove the deployblocker label here, and keep this open until we sort out which direction we want to move in. I'm of the mind to disallow typing on any pop up, but we want to hear some more thoughts from the team! Stay tuned.

@dangrous dangrous added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment labels Sep 12, 2023
@paultsimura
Copy link
Contributor

Just to sort some things out: if it appears that the issue is still relevant – will the proposals here potentially be reviewed, or it will it move to @b4s36t4?
So that I could know whether to unsubscribe from this issue's updates, thanks.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

99% I'm gonna tackle this issue (this will get closed) if we choose to keep the few popup open and allow typing. If we're going to disallow all popups to not focus there is nothing we're gonna do.

@dangrous dangrous removed the Hourly KSv2 label Sep 12, 2023
@dangrous
Copy link
Contributor

Okay, so after some discussion, we've decided that it makes sense to disallow typing when any pop up is open, so we don't need to work on this issue - as this is now expected behavior. Thanks for your patience!

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

No branches or pull requests

8 participants