Fix MenuButton behavior from toggle dropdown onMousePress to onClick #7335

Merged
kornatskyi merged 5 commits from master into master 2021-12-10 00:05:37 +01:00
kornatskyi commented 2021-12-09 06:51:14 +01:00 (Migrated from github.com)

Fixes

Issue Number: #7326

What is the current behavior?

MenuButton in the component claimMenuList toggles MenuList(dropdown) on mosePress event

What is the new behavior?

MenuButton in the component claimMenuList toggles MenuList(dropdown) on click event

Other information

MenuButtons in other components still toggle dropdowns on mouse press. It doesn't relate to this bugfix but my proposition is to change their behavior to toggle dropdown on click as well.

PR Checklist

Toggle...

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I added a line describing my change to CHANGELOG.md
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below
## Fixes Issue Number: #7326 <!-- Tip: - Add keywords to directly close the Issue when the PR is merged. - Skip the keyword if the Issue contains multiple items. - https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword --> ## What is the current behavior? `MenuButton` in the component `claimMenuList` toggles `MenuList`(dropdown) on mosePress event ## What is the new behavior? `MenuButton` in the component `claimMenuList` toggles `MenuList`(dropdown) on click event ## Other information <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. --> `MenuButton`s in other components still toggle dropdowns on mouse press. It doesn't relate to this bugfix but my proposition is to change their behavior to toggle dropdown on click as well. ## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> <details><summary>Toggle...</summary> What kind of change does this PR introduce? - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [ ] Other - Please describe: Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [ ] I added a line describing my change to CHANGELOG.md - [x] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below </details>
jessopb commented 2021-12-09 16:52:11 +01:00 (Migrated from github.com)

Thanks for the pr - I tried it and it indeed activated the menu onClick rather than on mouse down.
Two questions -

  1. does this have any implications for accessibility?
  2. should we try upgrading to v16 of reach-ui? There's a change there that might be relevant.
    https://github.com/reach/reach-ui/releases/tag/v0.16.0
Thanks for the pr - I tried it and it indeed activated the menu onClick rather than on mouse down. Two questions - 1) does this have any implications for accessibility? 2) should we try upgrading to v16 of reach-ui? There's a change there that might be relevant. https://github.com/reach/reach-ui/releases/tag/v0.16.0
kornatskyi commented 2021-12-09 18:46:03 +01:00 (Migrated from github.com)

Thank you for your review.

  1. Yes, I checked and it has an issue with handling the Enter key when an element is focused. I will fix it.
  2. I took a look at the reach-ui v0.16.0 code, and basically what they did is add a delay (400 ms) between mouse press and enabling selection on the dropdown. So it kind of solves the issue if a user doesn't click faster than 400ms. And it also will select a section if after pressing the mouse button you move the cursor 8px. I've tried their new package, and it solves the problem a little bit but not completely.
Thank you for your review. 1. Yes, I checked and it has an issue with handling the `Enter` key when an element is focused. I will fix it. 2. I took a look at the reach-ui v0.16.0 code, and basically what they did is add a delay (400 ms) between mouse press and enabling selection on the dropdown. So it kind of solves the issue if a user doesn't click faster than 400ms. And it also will select a section if after pressing the mouse button you move the cursor 8px. I've tried their new package, and it solves the problem a little bit but not completely.
jessopb commented 2021-12-09 20:26:42 +01:00 (Migrated from github.com)

Thanks. Let me know when it's ready.

Thanks. Let me know when it's ready.
kornatskyi commented 2021-12-09 23:12:24 +01:00 (Migrated from github.com)

Hey, I've messed up a little bit with git, sorry for those extra commits. I'm not sure if I have to do something else, or you already can accept my changes?

Hey, I've messed up a little bit with git, sorry for those extra commits. I'm not sure if I have to do something else, or you already can accept my changes?
jessopb (Migrated from github.com) approved these changes 2021-12-09 23:23:46 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#7335
No description provided.