Skip to content

Stop Popover from closing if mouse event is prevented#19106

Merged
tidy-dev merged 1 commit intodevelopmentfrom
fix-clear-button-in-preview-pull-request
Aug 14, 2024
Merged

Stop Popover from closing if mouse event is prevented#19106
tidy-dev merged 1 commit intodevelopmentfrom
fix-clear-button-in-preview-pull-request

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.

@tidy-dev tidy-dev requested a review from sergiou87 August 14, 2024 15:03
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
@tidy-dev tidy-dev deleted the fix-clear-button-in-preview-pull-request branch August 14, 2024 16:15
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