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

Fix portal bug in React v17 #217

Merged
merged 3 commits into from
Nov 25, 2020
Merged

Fix portal bug in React v17 #217

merged 3 commits into from
Nov 25, 2020

Conversation

WesCossick
Copy link
Member

Closes #216. Fixed by wrapping document.addEventListener() in a setTimeout().

While I was at it, I also prevented the useEffect() Hook from adding event listeners whenever the menu is closed.

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #217 (b272c46) into master (69a25ca) will increase coverage by 1.41%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
+ Coverage   80.72%   82.14%   +1.41%     
==========================================
  Files           1        1              
  Lines          83       84       +1     
  Branches       22       22              
==========================================
+ Hits           67       69       +2     
+ Misses         16       15       -1     
Impacted Files Coverage Δ
src/use-dropdown-menu.ts 82.14% <75.00%> (+1.41%) ⬆️

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 69a25ca...b272c46. Read the comment docs.

@WesCossick WesCossick merged commit 284c3b0 into master Nov 25, 2020
@WesCossick WesCossick deleted the fix-portal-bug branch November 25, 2020 22:23
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.

Dropdown immediately closes after clicking in rare circumstances
1 participant