We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea497d7 commit 43442feCopy full SHA for 43442fe
src/Autocomplete/assets/src/controller.ts
@@ -63,6 +63,10 @@ export default class extends Controller {
63
}
64
65
connect() {
66
+ this.initializeTomSelect();
67
+ }
68
+
69
+ initializeTomSelect() {
70
if (this.urlValue) {
71
this.tomSelect = this.#createAutocompleteWithRemoteData(
72
this.urlValue,
@@ -304,9 +308,8 @@ export default class extends Controller {
304
308
private resetTomSelect(): void {
305
309
if (this.tomSelect) {
306
310
this.stopMutationObserver();
307
- this.tomSelect.clearOptions();
- this.tomSelect.settings.maxOptions = this.getMaxOptions();
- this.tomSelect.sync();
311
+ this.tomSelect.destroy();
312
313
this.startMutationObserver();
314
315
0 commit comments