Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add event for rendered component on or-history

robindekkerse27d9b5b798c
diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.ts
index e81936306..172dbfd6b 100644
--- a/ui/component/or-attribute-history/src/index.ts
+++ b/ui/component/or-attribute-history/src/index.ts
@@ -253,7 +253,6 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
this._cleanup();
}
-
shouldUpdate(_changedProperties: PropertyValues): boolean {
let returnFalse = false;
@@ -367,8 +366,7 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
options: {
// maintainAspectRatio: false,
// REMOVED AS DOESN'T SIZE CORRECTLY responsive: true,
- maintainAspectRatio: false,
- onResize: () => this.dispatchEvent(new OrAttributeHistoryEvent('resize')),
+ onResize:() => this.dispatchEvent(new OrAttributeHistoryEvent('resize')),
legend: {
display: false
},
@@ -427,6 +425,15 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
} else if (!this._tableTemplate) {
this._tableTemplate = this._getTableTemplate();
}
+
+ this.onCompleted().then(() => {
+ this.dispatchEvent(new OrAttributeHistoryEvent('rendered'));
+ });
+
+ }
+
+ async onCompleted() {
+ await this.updateComplete;
}
protected _cleanup() {