oddbird / popover-polyfill

Polyfills the HTML popover attribute and showPopover/hidePopover/togglePopover methods onto HTMLElement, as well as the popovertarget and popovertargetaction attributes on <button> elements.
BSD 3-Clause "New" or "Revised" License
259 stars 14 forks source link

allow esc to be defaultpreventable #158

Closed keithamus closed 11 months ago

keithamus commented 11 months ago

Description

Browsers' native popover support allows for the Esc keypress to be preventable, which means that the popover won't close.

This is useful for capturing the Esc key behaviour from within a popover to do other things without closing the popover.

Currently the polyfill does not allow for this. This PR checks the flag to ensure default hasn't been prevented.

Steps to test/reproduce

Please explain how to best reproduce the issue and/or test the changes locally (including the pages/URLs/views/states to review). I can follow up with steps/tests if we feel it necessary (time is short right now).

Show me

Provide screenshots/animated gifs/videos if necessary.

netlify[bot] commented 11 months ago

Deploy Preview for popover-polyfill ready!

Name Link
Latest commit 74d2bdace6f1508b1ea47c9391b74e9e980c2016
Latest deploy log https://app.netlify.com/sites/popover-polyfill/deploys/6568c7b263aa5d0008f23a96
Deploy Preview https://deploy-preview-158--popover-polyfill.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

keithamus commented 11 months ago

@jgerigmeyer do you think you could release this one as a patch please?

jgerigmeyer commented 11 months ago

@jgerigmeyer do you think you could release this one as a patch please?

@keithamus Done!

keithamus commented 11 months ago

Much appreciated!