Fix container width not being set after latest scenes update (#76372)

* Fix container width after latest scenes update

* typecheck
This commit is contained in:
Dominik Prokop 2023-10-11 16:56:50 +02:00 committed by GitHub
parent c2cbb0a924
commit 46dc898a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,6 +52,12 @@ export function activateFullSceneTree(scene: SceneObject): SceneDeactivationHand
const deactivationHandlers: SceneDeactivationHandler[] = [];
scene.forEachChild((child) => {
// For query runners which by default use the container width for maxDataPoints calculation we are setting a width.
// In real life this is done by the React component when VizPanel is rendered.
if ('setContainerWidth' in child) {
// @ts-expect-error
child.setContainerWidth(500);
}
deactivationHandlers.push(activateFullSceneTree(child));
});