f5 / unovis

Modular data visualization framework for React, Angular, Svelte, Vue, and vanilla TypeScript or JavaScript
https://unovis.dev
Apache License 2.0
2.27k stars 44 forks source link

Core | Container: Improve ResizeObserver handling #463

Closed rokotyan closed 4 weeks ago

rokotyan commented 1 month ago

This PR fixes #455, a problem with ResizeObserver throwing an error when scrollbars appear/disappear. Solving this by delaying the resize by one frame.

The only tradeoff is scrollbar flickering when changing the size, but it only appears when "Show scroll bars" setting is set to "Always" on macOS (not sure about the other platforms).

image

https://github.com/user-attachments/assets/b6f15fe6-acad-484b-9712-bc51e48ca864

Changelog:

lee00678 commented 4 weeks ago

@rokotyan how so I test this? I removed height={400} after a npm run install:clean. Still not resizing for me with vertical changes.

https://github.com/user-attachments/assets/f460af78-545e-4281-a030-ffcd54559edc

rokotyan commented 4 weeks ago

@lee00678 I've pushed a new example for this

lee00678 commented 4 weeks ago

@lee00678 I've pushed a new example for this

Thanks for the clarification.

curran commented 4 weeks ago

Hooray!