Skip to content

Commit

Permalink
Fixing wrong variable
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Jan 22, 2024
1 parent a95a26a commit 98fc92a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/Autocomplete/assets/dist/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class default_1 extends Controller {
}
onMutations(mutations) {
let changeDisabledState = false;
let requireReset = false;
mutations.forEach((mutation) => {
switch (mutation.type) {
case 'attributes':
Expand All @@ -142,15 +143,15 @@ class default_1 extends Controller {
break;
}
if (mutation.target === this.element && mutation.attributeName === 'multiple') {
changeDisabledState = true;
requireReset = true;
break;
}
break;
}
});
const newOptions = this.selectElement ? this.createOptionsDataStructure(this.selectElement) : [];
const areOptionsEquivalent = this.areOptionsEquivalent(newOptions);
if (!areOptionsEquivalent || changeDisabledState) {
if (!areOptionsEquivalent || requireReset) {
this.originalOptions = newOptions;
this.resetTomSelect();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Autocomplete/assets/src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export default class extends Controller {
}

if (mutation.target === this.element && mutation.attributeName === 'multiple') {
changeDisabledState = true;
requireReset = true;

break;
}
Expand All @@ -367,7 +367,7 @@ export default class extends Controller {

const newOptions = this.selectElement ? this.createOptionsDataStructure(this.selectElement) : [];
const areOptionsEquivalent = this.areOptionsEquivalent(newOptions);
if (!areOptionsEquivalent || changeDisabledState) {
if (!areOptionsEquivalent || requireReset) {
this.originalOptions = newOptions;
this.resetTomSelect();
}
Expand Down
1 change: 0 additions & 1 deletion src/Autocomplete/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -586,4 +586,3 @@ the Symfony framework: https://symfony.com/doc/current/contributing/code/bc.html
.. _`controller.ts`: https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/src/controller.ts
.. _`Tom Select Render Templates`: https://tom-select.js.org/docs/#render-templates
.. _`Tom Select Option Group`: https://tom-select.js.org/examples/optgroups/
.. _`Live Component`: https://symfony.com/bundles/ux-live-component/current/index.html

0 comments on commit 98fc92a

Please sign in to comment.