Steps to reproduce:
- Create a new post, add a title, save it, then click Edit in Breakdance. You may need to enable Breakdance for the Posts post type first.
- In that post, add a section and a heading, then apply any entrance animation to the heading.
- Create a new page, add a title, save it, then click Edit in Breakdance.
- Add a section and then a Post List element that loads the post you created in step 1.
- View the page with the post list on the front end.
- Open your browser dev tools and inspect both the console for an error, and inspect the page HTML to see the extra inline script that is loaded there.
Expected behaviour:
The Post List(and Post Loop Builder) should only render the loop output for the post, and should not load entrance animation scripts for elements from inside the full post content that are not actually being rendered.
Actual behaviour:
The entrance animation script from the heading inside the original post gets injected into the page HTML anyway. That script then tries to animate a heading element that does not exist in the Post List output.
As a result, you get a JavaScript console error for every entrance animation used in that post, and for any other posts with entrance animations that are loaded into the loop. Also a bunch of unnecessary HTML bloat from all the inline scripts that get loaded.
The Post List is not rendering those content headings, nor should it be, but the associated animation scripts from each post element entrance animation are still being output onto the page HTML.
This adds up fast if your post content elements are all animated. In my case, a Post List loading just 7 posts produced 103 extra inline scripts bloating the page HTML, along with 103 JavaScript errors in the console.
Environment Details:
- Tested on two sites running Breakdance v2.6.1 and Breakdance v2.7.0-beta.1 respectively
- Firefox, Chrome, and Safari web browsers
- macOS 14.7.4
- WordPress v6.9.4
- PHP v8.4

Steps to reproduce:
Expected behaviour:
The Post List(and Post Loop Builder) should only render the loop output for the post, and should not load entrance animation scripts for elements from inside the full post content that are not actually being rendered.
Actual behaviour:
The entrance animation script from the heading inside the original post gets injected into the page HTML anyway. That script then tries to animate a heading element that does not exist in the Post List output.
As a result, you get a JavaScript console error for every entrance animation used in that post, and for any other posts with entrance animations that are loaded into the loop. Also a bunch of unnecessary HTML bloat from all the inline scripts that get loaded.
The Post List is not rendering those content headings, nor should it be, but the associated animation scripts from each post element entrance animation are still being output onto the page HTML.
This adds up fast if your post content elements are all animated. In my case, a Post List loading just 7 posts produced 103 extra inline scripts bloating the page HTML, along with 103 JavaScript errors in the console.
Environment Details: