Cleanup any listeners and media query instances!

This commit is contained in:
trading_peter 2025-01-19 16:55:12 +01:00
parent 482482fa09
commit 08ee579438
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@tp/tp-media-query", "name": "@tp/tp-media-query",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"main": "tp-media-query.js", "main": "tp-media-query.js",
"scripts": { "scripts": {

View File

@ -33,6 +33,11 @@ class TpMediaQuery extends LitElement {
this.checkQuery(); this.checkQuery();
} }
disconnectedCallback() {
super.disconnectedCallback();
this._remove();
}
checkQuery() { checkQuery() {
this._remove(); this._remove();
var query = this.query; var query = this.query;