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

Close modal on escape key #41

Open
drjjw opened this issue Feb 8, 2020 · 2 comments · May be fixed by #94
Open

Close modal on escape key #41

drjjw opened this issue Feb 8, 2020 · 2 comments · May be fixed by #94
Assignees

Comments

@drjjw
Copy link

drjjw commented Feb 8, 2020

I added this code to close the video modal on pressing escape key:

jQuery(document).keyup(function(e) { if (e.keyCode == 27) { // Esc jQuery(".modal-video-close-btn.js-modal-video-dismiss-btn").trigger("click") } });

@markmercier
Copy link

@drjjw good snippet!

I second this suggestion to have the escape key close the modal if opened; seems like a good accessibility improvement.

@uidev1116
Copy link

@drjjw @markmercier

Thanks!
that's nice idea.
I'll take it into consideration.

@1000-x-t30 1000-x-t30 self-assigned this Jun 19, 2023
@1000-x-t30 1000-x-t30 linked a pull request Jun 29, 2023 that will close this issue
@1000-x-t30 1000-x-t30 linked a pull request Jun 29, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants