microsoft / keyborg

A library that tracks browser keyboard focus state that powers tabster
MIT License
13 stars 5 forks source link

feat: support keyborg focusin event through shadow roots #51

Closed ling1726 closed 5 months ago

ling1726 commented 5 months ago

This PR adds a polyfill to keyborg so that it can detect focus changes within a shadow root.

focusin events don't seem to currently bubble out of an open shadow root, so when we detect that focus has moved into a shadow root we add a focusin listener to the shadow root to keep dispatching keborg focusin events.