Skip to content

Commit 2debd8b

Browse files
committed
Fix settings search icon blinking visibility at startup.
Checkbox.ts is wiping out classes added externally.
1 parent b305ca7 commit 2debd8b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/vs/base/browser/ui/checkbox/checkbox.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class Checkbox extends Widget {
4545

4646
this.domNode = document.createElement('div');
4747
this.domNode.title = this._opts.title;
48-
this.domNode.className = this._className();
48+
this.domNode.className = 'custom-checkbox ' + this._opts.actionClassName + ' ' + (this._checked ? 'checked' : 'unchecked');
4949
this.domNode.tabIndex = 0;
5050
this.domNode.setAttribute('role', 'checkbox');
5151
this.domNode.setAttribute('aria-checked', String(this._checked));
@@ -88,12 +88,13 @@ export class Checkbox extends Widget {
8888
public set checked(newIsChecked: boolean) {
8989
this._checked = newIsChecked;
9090
this.domNode.setAttribute('aria-checked', String(this._checked));
91-
this.domNode.className = this._className();
92-
this.applyStyles();
93-
}
91+
if (this._checked) {
92+
this.domNode.classList.add('checked');
93+
} else {
94+
this.domNode.classList.remove('checked');
95+
}
9496

95-
private _className(): string {
96-
return 'custom-checkbox ' + this._opts.actionClassName + ' ' + (this._checked ? 'checked' : 'unchecked');
97+
this.applyStyles();
9798
}
9899

99100
public width(): number {

0 commit comments

Comments
 (0)