@@ -45,7 +45,7 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
45
45
data . text = dom . append ( container , $ ( '.option-text' ) ) ;
46
46
data . decoratorRight = dom . append ( container , $ ( '.option-decorator-right' ) ) ;
47
47
data . itemDescription = dom . append ( container , $ ( '.option-text-description' ) ) ;
48
- dom . addClass ( data . itemDescription , 'visually-hidden' ) ;
48
+ data . itemDescription . classList . add ( 'visually-hidden' ) ;
49
49
50
50
return data ;
51
51
}
@@ -68,10 +68,10 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
68
68
69
69
// pseudo-select disabled option
70
70
if ( isDisabled ) {
71
- dom . addClass ( data . root , 'option-disabled' ) ;
71
+ data . root . classList . add ( 'option-disabled' ) ;
72
72
} else {
73
73
// Make sure we do class removal from prior template rendering
74
- dom . removeClass ( data . root , 'option-disabled' ) ;
74
+ data . root . classList . remove ( 'option-disabled' ) ;
75
75
}
76
76
}
77
77
@@ -162,7 +162,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
162
162
this . contextViewProvider = contextViewProvider ;
163
163
this . selectDropDownContainer = dom . $ ( '.monaco-select-box-dropdown-container' ) ;
164
164
// Use custom CSS vars for padding calculation (shared with parent select)
165
- dom . addClass ( this . selectDropDownContainer , 'monaco-select-box-dropdown-padding' ) ;
165
+ this . selectDropDownContainer . classList . add ( 'monaco-select-box-dropdown-padding' ) ;
166
166
167
167
// Setup container for select option details
168
168
this . selectionDetailsPane = dom . append ( this . selectDropDownContainer , $ ( '.select-box-details-pane' ) ) ;
@@ -309,7 +309,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
309
309
310
310
public render ( container : HTMLElement ) : void {
311
311
this . container = container ;
312
- dom . addClass ( container , 'select-container' ) ;
312
+ container . classList . add ( 'select-container' ) ;
313
313
container . appendChild ( this . selectElement ) ;
314
314
this . applyStyles ( ) ;
315
315
}
@@ -440,8 +440,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
440
440
this . layoutSelectDropDown ( ) ;
441
441
} ,
442
442
onHide : ( ) => {
443
- dom . toggleClass ( this . selectDropDownContainer , 'visible' , false ) ;
444
- dom . toggleClass ( this . selectElement , 'synthetic-focus' , false ) ;
443
+ this . selectDropDownContainer . classList . remove ( 'visible' ) ;
444
+ this . selectElement . classList . remove ( 'synthetic-focus' ) ;
445
445
} ,
446
446
anchorPosition : this . _dropDownPosition
447
447
} , this . selectBoxOptions . optionsAsChildren ? this . container : undefined ) ;
@@ -455,8 +455,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
455
455
render : ( container : HTMLElement ) => this . renderSelectDropDown ( container ) ,
456
456
layout : ( ) => this . layoutSelectDropDown ( ) ,
457
457
onHide : ( ) => {
458
- dom . toggleClass ( this . selectDropDownContainer , 'visible' , false ) ;
459
- dom . toggleClass ( this . selectElement , 'synthetic-focus' , false ) ;
458
+ this . selectDropDownContainer . classList . remove ( 'visible' ) ;
459
+ this . selectElement . classList . remove ( 'synthetic-focus' ) ;
460
460
} ,
461
461
anchorPosition : this . _dropDownPosition
462
462
} , this . selectBoxOptions . optionsAsChildren ? this . container : undefined ) ;
@@ -529,7 +529,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
529
529
if ( this . selectList ) {
530
530
531
531
// Make visible to enable measurements
532
- dom . toggleClass ( this . selectDropDownContainer , 'visible' , true ) ;
532
+ this . selectDropDownContainer . classList . add ( 'visible' ) ;
533
533
534
534
const selectPosition = dom . getDomNodePagePosition ( this . selectElement ) ;
535
535
const styles = getComputedStyle ( this . selectElement ) ;
@@ -584,8 +584,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
584
584
this . selectDropDownContainer . appendChild ( this . selectionDetailsPane ) ;
585
585
this . selectDropDownContainer . appendChild ( this . selectDropDownListContainer ) ;
586
586
587
- dom . removeClass ( this . selectionDetailsPane , 'border-top' ) ;
588
- dom . addClass ( this . selectionDetailsPane , 'border-bottom' ) ;
587
+ this . selectionDetailsPane . classList . remove ( 'border-top' ) ;
588
+ this . selectionDetailsPane . classList . add ( 'border-bottom' ) ;
589
589
590
590
} else {
591
591
this . _dropDownPosition = AnchorPosition . BELOW ;
@@ -594,8 +594,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
594
594
this . selectDropDownContainer . appendChild ( this . selectDropDownListContainer ) ;
595
595
this . selectDropDownContainer . appendChild ( this . selectionDetailsPane ) ;
596
596
597
- dom . removeClass ( this . selectionDetailsPane , 'border-bottom' ) ;
598
- dom . addClass ( this . selectionDetailsPane , 'border-top' ) ;
597
+ this . selectionDetailsPane . classList . remove ( 'border-bottom' ) ;
598
+ this . selectionDetailsPane . classList . add ( 'border-top' ) ;
599
599
}
600
600
// Do full layout on showSelectDropDown only
601
601
return true ;
@@ -655,8 +655,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
655
655
656
656
// Maintain focus outline on parent select as well as list container - tabindex for focus
657
657
this . selectDropDownListContainer . setAttribute ( 'tabindex' , '0' ) ;
658
- dom . toggleClass ( this . selectElement , 'synthetic-focus' , true ) ;
659
- dom . toggleClass ( this . selectDropDownContainer , 'synthetic-focus' , true ) ;
658
+ this . selectElement . classList . add ( 'synthetic-focus' ) ;
659
+ this . selectDropDownContainer . classList . add ( 'synthetic-focus' ) ;
660
660
661
661
return true ;
662
662
} else {
0 commit comments