mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
fixes #103167
This commit is contained in:
@@ -749,6 +749,16 @@ export function getShadowRoot(domNode: Node): ShadowRoot | null {
|
||||
return isShadowRoot(domNode) ? domNode : null;
|
||||
}
|
||||
|
||||
export function getActiveElement(): Element | null {
|
||||
let result = document.activeElement;
|
||||
|
||||
while (result?.shadowRoot) {
|
||||
result = result.shadowRoot.activeElement;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function createStyleSheet(container: HTMLElement = document.getElementsByTagName('head')[0]): HTMLStyleElement {
|
||||
let style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
|
||||
Reference in New Issue
Block a user