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
247 stars 14 forks source link

Polyfill for Javascript frameworks - React #204

Closed iankduffy closed 3 months ago

iankduffy commented 4 months ago

Wondering if they any way to get this to work with react, for unsupported browsers I see the class name flash as if it been updated but I dont actually see the class getting added. I am guessing a rerender is happening something where, so it loses the class.

Edit: Turns out this does work in react when I did a full build and start 🤦 - it just dev mode that didn't work, possible due to it running via useEffect and I was being stupid.

Not tested it yet on browser stack yet, but I can see the class being added and styles applied.