Close checks list when clicking outside of modal
Katsute opened this issue · comments
Description
Clicking anywhere outside the modal should just close it, every other modal that GH uses does close when you click outside the modal.
Example URLs
(any page that shows a commit check)
- https://github.com/refined-github/refined-github
- https://github.com/refined-github/refined-github/tree/main/source
- https://github.com/refined-github/refined-github/blob/main/source/manifest.json
This could be done by adding a click
event listener to: div.Dialog__Backdrop-sc-uaxjsn-0.gmJJZ
and check if the target is that specific element then click on the X button.
I could not get the dialog in the first link provided for examples though.
That's too bad, GitHub has always dealt with modals pretty well, especially because they never had a darkened background so people don't even know it's a modal. We used to have a feature for that #735
For what it's worth, that modal can be closed via ESC
Implemented on https://github.com/Katsute/refined-github/blob/9715f1caecd100c2b8c456b247a94d349e87c076/source/features/checks-modal.tsx using class^=
and class*=
Should I open a PR for this feature?