Skip to content

fix(search): close when clicking backdrop cross-browser #436

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

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

LeoMcA
Copy link
Member

@LeoMcA LeoMcA commented Jul 18, 2025

the closedby attribute on <dialog> allows us to close these (including the search) by clicking on the backdrop, but this doesn't work in Firefox Release (only Firefox Nightly). https://github.com/tak-dcxi/dialog-closedby-polyfill fixes this, but it's a bit heavy - and really covers all edge cases, which we don't use - so I cut it down a lot, and included only what we need

Tested in Firefox Release/Nightly and Chrome: would be great to get a test in Safari too

Copy link
Contributor

github-actions bot commented Jul 18, 2025

90938f2 was deployed to: https://fred-pr436.review.mdn.allizom.net/

Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

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

It works in Safari, but I also noticed that the layout is broken in Safari. It has nothing to do with the current PR, but might have appeared recently. The search is full height once it’s opened:

Image

@LeoMcA
Copy link
Member Author

LeoMcA commented Jul 21, 2025

@pepelsbey latest commit should fix that (tested in Epiphany)

Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

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

Looks good!

@LeoMcA LeoMcA merged commit 5972d79 into main Jul 21, 2025
7 of 8 checks passed
@LeoMcA LeoMcA deleted the dialog-closedby-polyfill branch July 21, 2025 11:20
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.

3 participants