Closed Christian24 closed 4 years ago
We're already going to make it easier to set shadow root options without overriding createRenderRoot
. So that's good :)
As for polyfilling, we would generally prefer to implement the native delegatesFocus feature in the web component polyfills. If that ends up being too costly, then maybe we'd consider something specific in LitElement. So for now, let's track this here: https://github.com/webcomponents/polyfills/issues/87
Description
Chrome provides a very handy field
ShadowRoot.delegatesFocus
. So far this is not part of the standard and only available in Chrome (according to MDN https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus). Since one of the ideas for v3 is to addit might make sense to improve ergonomics here too. This would probably not be part of the LitElement package, but maybe some other additional package, but I feel this would be useful to have resolved for both accessibility and keyboard navigation.
Maybe this could be polyfilled with a small footprint or some API abstraction is provided that allows to specify the element to delegate the focus to and and then just override
focus()
?Example:
I just feel it makes sense to achieve some sort of cross browser support.
Acceptance criteria