Skip to content

Commit 0699d44

Browse files
committed
bug #367 [Autocomplete] Not destroyed on disconnect() (mpiot)
This PR was merged into the 2.x branch. Discussion ---------- [Autocomplete] Not destroyed on disconnect() | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | Fix #366 | License | MIT Call the `destroy()` method from TomSelect on `disconnect` event of the Controller. (https://tom-select.js.org/docs/api/) Commits ------- 94d1972 Add disconnect() method
2 parents ba7c217 + 94d1972 commit 0699d44

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Autocomplete/assets/src/controller.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export default class extends Controller {
3939
this.tomSelect = this.#createAutocomplete();
4040
}
4141

42+
disconnect() {
43+
this.tomSelect.destroy();
44+
}
45+
4246
#getCommonConfig(): Partial<TomSettings> {
4347
const plugins: any = {}
4448

0 commit comments

Comments
 (0)