Description:
I am experiencing an issue where a custom Masonry grid (using Isotope/Packery) fails to calculate the container height correctly inside the Elementor Editor, resulting in style="height: 0px;" on the wrapper.
The Setup:
I am using the frontend/element_ready hook to initialize the grid. Even with imagesLoaded and a setTimeout delay, the grid often fails to compute the layout properly on the initial load or when the widget is updated in the panel.
$('.grid-test-masonry').each(function() {
var $this = $(this)
if (!$this.find('.grid-test-masonry').length) {
return
}
$this.imagesLoaded(function() {
$this.isotope({
itemSelector: '.item',
masonry: {
columnWidth: '.item'
}
})
})
})
Question:
Is there a specific Elementor internal event I should listen to, or a recommended way to ensure the DOM is fully "measured" before Isotope/Packery calculates the absolute positions?