Polyfills the HTML popover attribute and showPopover/hidePopover/togglePopover methods onto HTMLElement, as well as the popovertarget and popovertargetaction attributes on <button> elements.
So my fix for #149 works as it's supposed to. The scenario I did not account for is when there is no focusable content in the web component. In that case focusDelegate still returns the ShadowRoot and then errors in the popoverFocusingSteps.
I think this is due to the TreeWalker code where isFocusable falls through all the if statements and then returns focusTarget.tabIndex !== -1 which is true for the ShadowRoot?
So my fix for #149 works as it's supposed to. The scenario I did not account for is when there is no focusable content in the web component. In that case
focusDelegate
still returns theShadowRoot
and then errors in thepopoverFocusingSteps
.I think this is due to the
TreeWalker
code whereisFocusable
falls through all the if statements and then returnsfocusTarget.tabIndex !== -1
which is true for theShadowRoot
?