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: Prevent Dropdown Flickering on 'mousedown' rootCloseEvent #6714
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi @kyletsang, could you kindly review my pull request (PR) when you have a moment? |
Could you add a test for this? |
Hey @kyletsang, added a test for the same. |
@kyletsang, Can you review the PR once more? I would like to get this PR merged before Hacktoberfest ends. |
kyletsang
approved these changes
Oct 29, 2023
Thanks |
This was referenced May 24, 2024
This was referenced May 24, 2024
This was referenced May 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Closes #6712 and #3196
Description
This pull request addresses the issue reported in #6712. When a dropdown is open with rootCloseEvent set to 'mousedown,' it currently exhibits flickering behavior when the toggle button is clicked. This issue arises due to the combination of hiding and showing the dropdown within the same click event.
Changes Made
To resolve this issue, I've made the following changes:
Modified the handleToggle function to skip execution when the dropdown is open, and rootCloseEvent is set to 'mousedown,' and the toggle button is clicked. This change prevents the flickering behavior by allowing the dropdown to remain open in this specific scenario.
Result
React-Bootstrap.Dropdown.menu.flickering.issue.mp4
Additional Information
This change is made in response to the issue reported by @Fyers. We believe this modification improves the behavior of the dropdown component when rootCloseEvent is set to 'mousedown.'
I kindly request a review from the maintainers and the community to consider including this fix in the React Bootstrap project.