aybolit icon indicating copy to clipboard operation
aybolit copied to clipboard

docs(core): how and when to use delegate-focus-mixin.js

Open lkraav opened this issue 6 years ago • 3 comments

https://github.com/web-padawan/aybolit/blob/116c91840792132bece7f784a364f707537d6d9f/packages/core/src/mixins/delegate-focus-mixin.js

Some @aybolit/core components are using it, but a few are not. What is the decision criteria?

https://github.com/Polymer/lit-element/issues/586 may be related on upstream end?

lkraav avatar Apr 22 '19 00:04 lkraav

The main reason is that only Chrome currently supports the sequential focus navigation:

this.attachShadow({mode: 'open', delegatesFocus: true});

The mixin is needed whenever you have a focusable element (input, button etc) within a shadow root. https://github.com/vaadin/vaadin-control-state-mixin does pretty much the same thing.

web-padawan avatar Apr 23 '19 13:04 web-padawan

Maybe a docs(...): ... commit would be a good idea about this in some README.md.

lkraav avatar May 15 '19 09:05 lkraav

The mixin is considered implementation detail at the moment. But yes, we could add some docs.

web-padawan avatar May 15 '19 09:05 web-padawan