fixed: check pane element exists before observing
This commit is contained in:
@ -962,6 +962,8 @@ export function drawIndicatorsOnChart() {
|
|||||||
|
|
||||||
// Subscribe to pane height changes to save to localStorage
|
// Subscribe to pane height changes to save to localStorage
|
||||||
const originalHeight = storedHeight;
|
const originalHeight = storedHeight;
|
||||||
|
const paneElement = pane.getHTMLElement && pane.getHTMLElement();
|
||||||
|
if (paneElement) {
|
||||||
const resizeObserver = new ResizeObserver((entries) => {
|
const resizeObserver = new ResizeObserver((entries) => {
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const newHeight = Math.round(entry.contentRect.height);
|
const newHeight = Math.round(entry.contentRect.height);
|
||||||
@ -972,7 +974,8 @@ export function drawIndicatorsOnChart() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
resizeObserver.observe(pane.getHTMLElement());
|
resizeObserver.observe(paneElement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user