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

Stop Popover from closing if mouse event is prevented #19106

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

tidy-dev
Copy link
Contributor

xref: https://github.com/github/accessibility-audits/issues/8591

Description

When the 'x' close button in the branch popover dropdown is invoked, the textbox removes the 'x' close button from the DOM. Next, in the popover component handles the click event looking for a click event "Outside the popover" which it checks for by seeing if the target of the click is contained by the popover... which it isn't now that it has been removed.

Thus, I called e.preventDefault() and in that subsequent popover event handling added the check to see if the event had been prevented and if so to ignore it.

Screenshots

CleanShot.2024-08-14.at.11.01.04.mp4

Video shows invoking the clear button via enter key and via clicking and neither closes the popover.

Release notes

Notes: [Fixed] The branch selection popover in the Open a Pull Request Dialog does not close on filter clearing.

Copy link
Member

@sergiou87 sergiou87 left a comment

Choose a reason for hiding this comment

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

@tidy-dev tidy-dev merged commit cbb650a into development Aug 14, 2024
7 checks passed
@tidy-dev tidy-dev deleted the fix-clear-button-in-preview-pull-request branch August 14, 2024 16:15
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants