提交 614eaed5 编写于 作者: B Benjamin Pasero

dialog - fix checkbox toggle to work properly

上级 ce1e0612
......@@ -45,6 +45,6 @@
}
/* hide check when unchecked */
.monaco-custom-checkbox.monaco-simple-checkbox.unchecked:not(.checked)::before {
visibility: hidden;;
.monaco-custom-checkbox.monaco-simple-checkbox:not(.checked)::before {
visibility: hidden;
}
......@@ -108,7 +108,9 @@ export class Checkbox extends Widget {
if (this._opts.actionClassName) {
classes.push(this._opts.actionClassName);
}
classes.push(this._checked ? 'checked' : 'unchecked');
if (this._checked) {
classes.push('checked');
}
this.domNode = document.createElement('div');
this.domNode.title = this._opts.title;
......@@ -154,12 +156,9 @@ export class Checkbox extends Widget {
set checked(newIsChecked: boolean) {
this._checked = newIsChecked;
this.domNode.setAttribute('aria-checked', String(this._checked));
if (this._checked) {
this.domNode.classList.add('checked');
} else {
this.domNode.classList.remove('checked');
}
this.domNode.classList.toggle('checked', this._checked);
this.applyStyles();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册