File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ class MultiSelect extends BaseComponent {
286
286
}
287
287
288
288
_getClassNames ( ) {
289
- return [ ... this . _element . classList . value . split ( ' ' ) ]
289
+ return this . _element . classList . value . split ( ' ' )
290
290
}
291
291
292
292
_getOptions ( node = this . _element ) {
@@ -355,12 +355,7 @@ class MultiSelect extends BaseComponent {
355
355
356
356
_createNativeOptions ( parentElement , options ) {
357
357
for ( const option of options ) {
358
- if ( ( typeof option . options !== 'undefined' ) ) {
359
- const optgroup = document . createElement ( 'optgroup' )
360
- optgroup . label = option . label
361
- this . _createNativeOptions ( optgroup , option . options )
362
- parentElement . append ( optgroup )
363
- } else {
358
+ if ( ( typeof option . options === 'undefined' ) ) {
364
359
const opt = document . createElement ( 'OPTION' )
365
360
opt . value = option . value
366
361
@@ -374,6 +369,11 @@ class MultiSelect extends BaseComponent {
374
369
375
370
opt . innerHTML = option . text
376
371
parentElement . append ( opt )
372
+ } else {
373
+ const optgroup = document . createElement ( 'optgroup' )
374
+ optgroup . label = option . label
375
+ this . _createNativeOptions ( optgroup , option . options )
376
+ parentElement . append ( optgroup )
377
377
}
378
378
}
379
379
}
You can’t perform that action at this time.
0 commit comments