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 Popper Timeout Tracking #1417

Merged
merged 5 commits into from
Jun 21, 2024
Merged

Fix Popper Timeout Tracking #1417

merged 5 commits into from
Jun 21, 2024

Conversation

jherdman
Copy link
Contributor

Description

We noticed that Popper was sometimes closing the dorpdown inaccurately.
This was pinned down to timeouts being incorrectly cleared, and thefore
sometimes running when they ought not to. Careful examination of the
code revealed that they weren't being tracked very well, and thus stomped on
or lost.

This approach leverages a ref to track the value to avoid loss during
re-renders, and to also avoid unnecessary re-renders.

Changes include

  • breaking change: a change that is not backwards-compatible and/or changes current functionality
  • fix: a non-breaking change that solves an issue
  • feature: a non-breaking change that adds functionality
  • chore: contains no changes affecting the library, such as documentation or test updates

Feature checklist

  • Appropriate tests have been added
  • Documentation has been updated
  • Accessibility has been considered

* Add a few missing types
* Let the code breathe a bit
const handleKeyDown = (event) => {
switch (event.keyCode) {
const handleKeyDown = (event: KeyboardEvent) => {
switch (event.code) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was a result of typing the event. Once this was fixed the types informed me (correctly) that keyCode is deprecated in favour of code.

@jherdman jherdman marked this pull request as ready for review May 27, 2024 20:50
We noticed that Popper was sometimes closing the dorpdown inaccurately.
This was pinned down to timeouts being incorrectly cleared, and thefore
sometimes running when they ought not to. Careful examination of the
code revealed that they weren't being tracked very well, and thus stomped on
or lost.

This approach leverages a ref to track the value to avoid loss during
re-renders, and to also avoid unnecessary re-renders.
@haideralsh haideralsh merged commit e026714 into master Jun 21, 2024
5 checks passed
@haideralsh haideralsh deleted the GO-8003 branch June 21, 2024 17:53
github-actions bot pushed a commit that referenced this pull request Jun 21, 2024
## [10.2.8](v10.2.7...v10.2.8) (2024-06-21)

### Bug Fixes

* Popper Timeout Tracking ([#1417](#1417)) ([e026714](e026714))
Copy link

🎉 This PR is included in version 10.2.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants