Merge pull request #3170 from blois/shadow_root

Incorporate shadowRoot in focus calculation.
This commit is contained in:
Daniel Imms
2020-11-09 16:17:09 -08:00
committed by GitHub
+2 -1
View File
@@ -14,6 +14,7 @@ export class CoreBrowserService implements ICoreBrowserService {
}
public get isFocused(): boolean {
return document.activeElement === this._textarea && document.hasFocus();
const docOrShadowRoot = this._textarea.getRootNode ? this._textarea.getRootNode() as Document | ShadowRoot : document;
return docOrShadowRoot.activeElement === this._textarea && document.hasFocus();
}
}