mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 05:16:34 +00:00
Add slight hysteresis to chart height to prevent scrollbar juddering (#15321)
This commit is contained in:
parent
d8fe7d9a01
commit
1e7fe59519
@ -233,7 +233,11 @@ export default class HaChartBase extends LitElement {
|
|||||||
{
|
{
|
||||||
id: "afterRenderHook",
|
id: "afterRenderHook",
|
||||||
afterRender: (chart) => {
|
afterRender: (chart) => {
|
||||||
this._chartHeight = chart.height;
|
const change = chart.height - (this._chartHeight ?? 0);
|
||||||
|
if (!this._chartHeight || change > 0 || change < -12) {
|
||||||
|
// hysteresis to prevent infinite render loops
|
||||||
|
this._chartHeight = chart.height;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
...this.options?.plugins?.legend,
|
...this.options?.plugins?.legend,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user