Add a guard to check if activeElement exists.

This commit is contained in:
Hyunje Alex Jun
2015-02-05 19:18:35 +00:00
parent bd22fc0e58
commit 2fc41e7045

View File

@@ -470,12 +470,15 @@
}
var activeElement = document.activeElement ? document.activeElement : ownerDocument.activeElement;
// go deeper if element is a webcomponent
while (activeElement.shadowRoot) {
activeElement = activeElement.shadowRoot.activeElement;
}
if ($(activeElement).is(":input,[contenteditable]")) {
return;
if (activeElement) {
// go deeper if element is a webcomponent
while (activeElement.shadowRoot) {
activeElement = activeElement.shadowRoot.activeElement;
}
if ($(activeElement).is(":input,[contenteditable]")) {
return;
}
}
var deltaX = 0;