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.
https://popover.oddbird.net
BSD 3-Clause "New" or "Revised" License
269 stars 14 forks source link

Why doesn't the polyfill move the popover to top-layer? #122

Closed wmertens closed 1 year ago

wmertens commented 1 year ago

Is there a reason why this can't or won't be done? CSS or something?

reify-benjamin-solum commented 1 year ago

I believe Popover and Top Layer shipped together in browsers so in the event that this polyfill is needed there is no top layer to add anything to.

Also, from mdn:

Note that the top layer is an internal browser concept and cannot be directly manipulated from code.

wmertens commented 1 year ago

Right, I meant that it would add a div to the body and move the popover element into it, but that may wreak havoc on frameworks so it's not really an option.