mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
Fix safari not rendering history graph (#7025)
This commit is contained in:
parent
9b25a54a47
commit
a8a1563586
@ -62,12 +62,22 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
||||
this.drawChart();
|
||||
}
|
||||
|
||||
ready() {
|
||||
super.ready();
|
||||
// safari doesn't always render the canvas when we animate it, so we remove overflow hidden when the animation is complete
|
||||
this.addEventListener("transitionend", () => {
|
||||
this.style.overflow = "auto";
|
||||
});
|
||||
}
|
||||
|
||||
dataChanged() {
|
||||
this.drawChart();
|
||||
}
|
||||
|
||||
_onRenderedChanged(rendered) {
|
||||
if (rendered) this.animateHeight();
|
||||
if (rendered) {
|
||||
this.animateHeight();
|
||||
}
|
||||
}
|
||||
|
||||
animateHeight() {
|
||||
@ -79,15 +89,15 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
||||
}
|
||||
|
||||
drawChart() {
|
||||
if (!this._isAttached) {
|
||||
return;
|
||||
}
|
||||
|
||||
const unit = this.unit;
|
||||
const deviceStates = this.data;
|
||||
const datasets = [];
|
||||
let endTime;
|
||||
|
||||
if (!this._isAttached) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (deviceStates.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user