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 {
286286 }
287287
288288 _getClassNames ( ) {
289- return [ ... this . _element . classList . value . split ( ' ' ) ]
289+ return this . _element . classList . value . split ( ' ' )
290290 }
291291
292292 _getOptions ( node = this . _element ) {
@@ -355,12 +355,7 @@ class MultiSelect extends BaseComponent {
355355
356356 _createNativeOptions ( parentElement , options ) {
357357 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' ) ) {
364359 const opt = document . createElement ( 'OPTION' )
365360 opt . value = option . value
366361
@@ -374,6 +369,11 @@ class MultiSelect extends BaseComponent {
374369
375370 opt . innerHTML = option . text
376371 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 )
377377 }
378378 }
379379 }
You can’t perform that action at this time.
0 commit comments