grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
133 stars 20 forks source link

LazyLoader: Hide wrapper if child is hidden #823

Closed svennergr closed 2 months ago

svennergr commented 2 months ago

When using a SceneCSSGridLayout, the isLazy property and items setting their isHidden property dynamically, the LazyLoader would still be visible.

This PR just subscribes to the item's state and also hides the LazyLoader.

📦 Published PR as canary version: 5.3.8--canary.823.9872224365.0
:sparkles: Test out this PR locally via: ```bash npm install @grafana/scenes-react@5.3.8--canary.823.9872224365.0 npm install @grafana/scenes@5.3.8--canary.823.9872224365.0 # or yarn add @grafana/scenes-react@5.3.8--canary.823.9872224365.0 yarn add @grafana/scenes@5.3.8--canary.823.9872224365.0 ```
svennergr commented 2 months ago

@torkelo I pushed another approach of just hiding empty divs with css when loaded. PTAL.

dprokop commented 2 months ago

@svennergr - I think the css only approach is better compared to the first approach. Just gonna ask @kaydelaney for look on this too.

I've tested with the lazy demos that we have for grid layout and I have not observed any regression. Gonna have a look in core grafana dashboards as soon as the canary is released.

grafanabot commented 2 months ago

:rocket: PR was released in v5.3.8 :rocket: