- From: Takayoshi Kochi <notifications@github.com>
- Date: Thu, 04 Feb 2016 02:22:40 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
Received on Thursday, 4 February 2016 10:23:10 UTC
@rniwa if a slot can be `ShadowRoot.activeElement`, what's the idiom to know the exact focused element? ```javascript // some pseudo code included focused = root.activeElement; if (focused.tagName == 'SLOT') { for (node in focused.getAssignedNodes()) { if (node is really focused) return node; } } return focused; ``` (Probably there's a better way than mine :) Or is it enough that a component knows *some element* under `<slot>` is focused, and it doesn't care which element it is? If you have any good use case scenario, could you share? --- Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/358#issuecomment-179753869
Received on Thursday, 4 February 2016 10:23:10 UTC