fix: memory leak in color picker widget (#199815)

This commit is contained in:
Simon Siefke
2023-12-04 15:00:02 +01:00
committed by GitHub
parent 56934582c3
commit 38347ca237
@@ -117,9 +117,9 @@ class CloseButton extends Disposable {
const closeButton = dom.append(innerDiv, $('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize('closeIcon', 'Icon to close the color picker')))));
closeButton.classList.add('close-icon');
this._button.onclick = () => {
this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => {
this._onClicked.fire();
};
}));
}
}
@@ -455,9 +455,9 @@ export class InsertButton extends Disposable {
this._button = dom.append(container, document.createElement('button'));
this._button.classList.add('insert-button');
this._button.textContent = 'Insert';
this._button.onclick = e => {
this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => {
this._onClicked.fire();
};
}));
}
public get button(): HTMLElement {