GoogleChrome / dialog-polyfill

Polyfill for the HTML dialog element
BSD 3-Clause "New" or "Revised" License
2.45k stars 245 forks source link

Support finding focusable items in custom element shadow roots #179

Closed ChadKillingsworth closed 4 years ago

ChadKillingsworth commented 5 years ago

When searching for a focusable item, we need to consider that the dialog may contain custom elements which have shadow roots. If we fail to find a focusable target by conventional means, look for custom elements (must have a '-' in the tag name) and search their shadow roots recursively.

Screen Shot 2019-04-05 at 7 16 56 AM
ChadKillingsworth commented 5 years ago

I think this may replace #136

samthor commented 5 years ago

I think this is totally orthogonal to #136, which is trying to make sure <dialog> works when it's within a shadow root.

ChadKillingsworth commented 5 years ago

Turns out the safeBlur function also needed a tweak to support shadowDom.

ChadKillingsworth commented 4 years ago

ping @samthor