Skip to content

Fix listener added and removed wrong order #293

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

Merged
merged 5 commits into from
Jan 21, 2022

Conversation

corymharper
Copy link
Contributor

This pull request adds a fix for event listeners that were being added and removed in the wrong order.

Closes #292

@codecov
Copy link

codecov bot commented Jan 18, 2022

Codecov Report

Merging #293 (65ca9b2) into master (8f8c123) will decrease coverage by 1.48%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
- Coverage   90.90%   89.42%   -1.49%     
==========================================
  Files           1        1              
  Lines          99      104       +5     
  Branches       32       33       +1     
==========================================
+ Hits           90       93       +3     
- Misses          7        8       +1     
- Partials        2        3       +1     
Impacted Files Coverage Δ
src/use-dropdown-menu.ts 89.42% <66.66%> (-1.49%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f8c123...65ca9b2. Read the comment docs.

@WesCossick
Copy link
Member

I'm assuming this solution works reliably? With both the physical escape key and the virtual one on the touch bar?

corymharper and others added 2 commits January 19, 2022 10:19
Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
@corymharper
Copy link
Contributor Author

corymharper commented Jan 19, 2022

I'm assuming this solution works reliably? With both the physical escape key and the virtual one on the touch bar?

Yes, the virtual escape key was not a specialized case but rather just an author catching the problem with a very specific scenario, the virtual escape key just fires the same event as the physical escape key. Besides that, I was not able to reproduce the bug after these changes, and it makes sense, with run to completion in mind, this approach will always detect if removal has happened before addition.

@corymharper corymharper dismissed WesCossick’s stale review January 21, 2022 19:14

All requested changes have been made

@WesCossick WesCossick merged commit bb3e929 into master Jan 21, 2022
@WesCossick WesCossick deleted the fix-listener-added-and-removed-wrong-order branch January 21, 2022 19:32
msakrejda pushed a commit to msakrejda/react-accessible-dropdown-menu-hook that referenced this pull request Feb 21, 2022
…and-removed-wrong-order

Fix listener added and removed wrong order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

If you hold down the escape key then click the dropdown, it doesn't open again
2 participants