mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
clearNode should use replaceChildren (#157169)
The new-ish `replaceChildren` api lets us quickly remove all children of an html element without having to iterate through the children
This commit is contained in:
@@ -19,9 +19,7 @@ import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export function clearNode(node: HTMLElement): void {
|
||||
while (node.firstChild) {
|
||||
node.firstChild.remove();
|
||||
}
|
||||
node.replaceChildren();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user