sbb-design-systems / lyne-components

Components for Lyne Design System
https://lyne-storybook.app.sbb.ch
MIT License
43 stars 13 forks source link

fix: ensure slotchange events are handled correctly in hydration #2850

Closed kyubisation closed 1 week ago

kyubisation commented 1 week ago

This PR slightly changes how we handled slotchange events during hydration. Previously we would stop slotchange events during hydration and re-dispatch them afterwards. However, it seems that during true page load with server side rendering, slotchange events are not dispatched at all. So we changed the logic to just generally suppress slotchange events during hydration and manually dispatch a slotchange event, for any slot having content assigned, after the hydration is finished.