From 01916e6ee0e0427747cb1d9378e93bf73dcdde7c Mon Sep 17 00:00:00 2001 From: Jan Klan Date: Mon, 8 Aug 2022 07:59:00 +0930 Subject: [PATCH] Unset tomSelect after destroying the instance fix #407 --- src/Autocomplete/assets/src/controller.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Autocomplete/assets/src/controller.ts b/src/Autocomplete/assets/src/controller.ts index 2b6eacf2d1c..e140be2dcf2 100644 --- a/src/Autocomplete/assets/src/controller.ts +++ b/src/Autocomplete/assets/src/controller.ts @@ -41,6 +41,8 @@ export default class extends Controller { disconnect() { this.tomSelect.destroy(); + // Fixes https://github.com/symfony/ux/issues/407 + this.tomSelect = undefined; } #getCommonConfig(): Partial {