File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ class default_1 extends Controller {
134
134
}
135
135
onMutations ( mutations ) {
136
136
let changeDisabledState = false ;
137
+ let requireReset = false ;
137
138
mutations . forEach ( ( mutation ) => {
138
139
switch ( mutation . type ) {
139
140
case 'attributes' :
@@ -142,15 +143,15 @@ class default_1 extends Controller {
142
143
break ;
143
144
}
144
145
if ( mutation . target === this . element && mutation . attributeName === 'multiple' ) {
145
- changeDisabledState = true ;
146
+ requireReset = true ;
146
147
break ;
147
148
}
148
149
break ;
149
150
}
150
151
} ) ;
151
152
const newOptions = this . selectElement ? this . createOptionsDataStructure ( this . selectElement ) : [ ] ;
152
153
const areOptionsEquivalent = this . areOptionsEquivalent ( newOptions ) ;
153
- if ( ! areOptionsEquivalent || changeDisabledState ) {
154
+ if ( ! areOptionsEquivalent || requireReset ) {
154
155
this . originalOptions = newOptions ;
155
156
this . resetTomSelect ( ) ;
156
157
}
Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ export default class extends Controller {
356
356
}
357
357
358
358
if ( mutation . target === this . element && mutation . attributeName === 'multiple' ) {
359
- changeDisabledState = true ;
359
+ requireReset = true ;
360
360
361
361
break ;
362
362
}
@@ -367,7 +367,7 @@ export default class extends Controller {
367
367
368
368
const newOptions = this . selectElement ? this . createOptionsDataStructure ( this . selectElement ) : [ ] ;
369
369
const areOptionsEquivalent = this . areOptionsEquivalent ( newOptions ) ;
370
- if ( ! areOptionsEquivalent || changeDisabledState ) {
370
+ if ( ! areOptionsEquivalent || requireReset ) {
371
371
this . originalOptions = newOptions ;
372
372
this . resetTomSelect ( ) ;
373
373
}
Original file line number Diff line number Diff line change @@ -586,4 +586,3 @@ the Symfony framework: https://symfony.com/doc/current/contributing/code/bc.html
586
586
.. _`controller.ts` : https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/src/controller.ts
587
587
.. _`Tom Select Render Templates` : https://tom-select.js.org/docs/#render-templates
588
588
.. _`Tom Select Option Group` : https://tom-select.js.org/examples/optgroups/
589
- .. _`Live Component` : https://symfony.com/bundles/ux-live-component/current/index.html
You can’t perform that action at this time.
0 commit comments