Add support of iframe for keyboard event
Really simple piece of code to add support of iframe in keyboard event activeElement test.
This commit is contained in:
parent
3ba211133d
commit
636eaffd41
@ -53,9 +53,13 @@ function bindKeyboardHandler(element, i) {
|
|||||||
|
|
||||||
var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
|
var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
|
||||||
if (activeElement) {
|
if (activeElement) {
|
||||||
// go deeper if element is a webcomponent
|
if (activeElement.tagName === 'IFRAME') {
|
||||||
while (activeElement.shadowRoot) {
|
activeElement = activeElement.contentDocument.activeElement;
|
||||||
activeElement = activeElement.shadowRoot.activeElement;
|
} else {
|
||||||
|
// go deeper if element is a webcomponent
|
||||||
|
while (activeElement.shadowRoot) {
|
||||||
|
activeElement = activeElement.shadowRoot.activeElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (h.isEditable(activeElement)) {
|
if (h.isEditable(activeElement)) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user