Register toggle since it's a disposable (#208249)

Saw this in our unit tests when I was playing with depending on Checkbox.
This commit is contained in:
Tyler James Leonhardt 2024-03-20 15:15:03 -07:00 committed by GitHub
parent 288be7d337
commit 78d4f34a94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -237,7 +237,7 @@ export class Checkbox extends Widget {
constructor(private title: string, private isChecked: boolean, styles: ICheckboxStyles) {
super();
this.checkbox = new Toggle({ title: this.title, isChecked: this.isChecked, icon: Codicon.check, actionClassName: 'monaco-checkbox', ...unthemedToggleStyles });
this.checkbox = this._register(new Toggle({ title: this.title, isChecked: this.isChecked, icon: Codicon.check, actionClassName: 'monaco-checkbox', ...unthemedToggleStyles }));
this.domNode = this.checkbox.domNode;