Properly destroy tomSelect on disconnect()

This commit is contained in:
Jan Böhmer 2023-02-12 17:53:10 +01:00
parent f22d65cd24
commit 400cc44838
7 changed files with 44 additions and 0 deletions

View file

@ -79,4 +79,10 @@ export default class extends Controller {
this._tomSelect = new TomSelect(this.element, settings);
}
disconnect() {
super.disconnect();
//Destroy the TomSelect instance
this._tomSelect.destroy();
}
}