After an initial investigation, have noticed that the slideHeights element for embla-carousel-auto-height was being calculated only when initializing the plugin, which does not detect dynamic changes to the carousel elements
The proposed solution leverages ResizeObsevers to detect changes to the slide heights and re-calculate them properly
ResizeObservers do have relevant coverage with all major browsers, being a good candidate for the solution. Open for new ideas as always on how we could increase support
Context
After an initial investigation, have noticed that the
slideHeights
element forembla-carousel-auto-height
was being calculated only when initializing the plugin, which does not detect dynamic changes to the carousel elementsThe proposed solution leverages ResizeObsevers to detect changes to the slide heights and re-calculate them properly
Solving https://github.com/davidjerleke/embla-carousel/issues/910
Additional Details
ResizeObservers do have relevant coverage with all major browsers, being a good candidate for the solution. Open for new ideas as always on how we could increase support