WIP: Component blocks, element scripts aren't enqueued in the editor

For Bricks elements that enqueue their own scripts, via the enqueue_scripts() method from Bricks’ element API… the enqueuing only happens on the front end or when in Bricks builder but not when they’re inside of a component that is being used as a block when viewing inside the block editor. This can result in broken layouts and inaccessible content when viewing inside the block editor.

As a simple example… the issue can be seen with the nestable slider or the image gallery when set to use masonry.

To reproduce, add a nestable slider or gallery set to masonry inside of a component and turn into a ‘block’. Then add that block to any post / page.

Screen recording showing the issue - Viewing slider & masonry in editor

Notice the slider isn’t initialised and neither is the masonry layout when viewing in the editor (due to the splide and isotope / photoswipe not being enqueued).

It’s not just these two element, it’s any elements using enqueue_scripts().

(Most likely enqueue_scripts() in the API just needs to be added to a gutenberg / block editor specific hook to ensure it is working in the editor view also)

Hi @wplit,

thank you. I was able to replicate it and I’ve added it to the internal bug tracker.

Matej

Do we have an update here or a work around in the mean time?
Trying to enqueue splide so Nested Slider works in Gutenberg.

Not yet, not that I’m aware of.

Best regards,
Matej

Seems like a fairly important one to resolve amigo.