Open davidturissini opened 6 years ago
Few things that were discussed today (@ekashida and myself):
activeElement
in a custom element with delegatesFocus on. We need some investigation to see how the spec works, e.g.: what if you have x-foo x-bar and input, composed via shadow boundaries, and the focus in place on the input, and x-foo has delegatesFocus on, but x-bar doesn't. In this case, what is the value of this.template.activeElement
in x-foo and x-bar?:focus
selector in CSS (in fallback mode, the focus is never really on the custom element, but on a child of it). We can explore focusin/focusout to see if we can add a html attribute that we can use in our css transformer.The missing piece here is the :focus
css rule, that is not implemented yet. Let's keep this open.
I'd like to add a few more things, based on the following example: https://playground.lwcjs.org/projects/8nbbO02BF/4/edit
(Assuming static delegatesFocus = true
)
focus
on x-button does not set the focus on the button element as expected. However, setting tabindex=0
on the host, does indeed focus the button inside the shadowh3
element inside x-button, the host doesn't get the :focus
but I believe this is yet to be implemented, just wanted to make sure we are following the spec here.tabindex=-1
is set on the host, then the button doesn't get focused. I'm unclear on the behavior for this one, however, I'd expect this gets ignored since as a component author, I'm specifying that my component does delegatesFocus and therefore should be respected. I see this as a form of "introspection", it's like styling an internal of my component that the consumer shouldn't have access to.Referencing a couple of issues I've recently discovered: https://github.com/salesforce/lwc/issues/1032 and https://github.com/salesforce/lwc/issues/1031
Description
Implement
delegatesFocus
static prop so LWC input focus can skip the custom element container.