Skip to content

[MOOSE-407]: Block animation classes accumulate in "Additional CSS Class(es)" field#369

Open
spadilha wants to merge 3 commits into
mainfrom
fix/MOOSE-407/block-animation-classes-issue
Open

[MOOSE-407]: Block animation classes accumulate in "Additional CSS Class(es)" field#369
spadilha wants to merge 3 commits into
mainfrom
fix/MOOSE-407/block-animation-classes-issue

Conversation

@spadilha

@spadilha spadilha commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What does this do/fix?

Fix animation classes accumulating in "Additional CSS Class(es)" field

When a block had animation settings configured, the animationControls HOC was appending animation classes to attributes.className and passing them back to BlockEdit. WordPress displays attributes.className in the "Additional CSS Class(es)" field, so any edit to that field would save the animation classes back into the attribute. On the next render, the HOC would append them again on top of what was already there, causing the classes to multiply on every keystroke.

The fix removes the className override from blockProps entirely. Animation classes for the saved output are already handled by the applyAnimationProps filter (blocks.getSaveContent.extraProps), so the HOC never needed to write them back into attributes.className in the first place. The HOC now only overrides style (for animation CSS custom properties) and leaves attributes.className untouched.

File changed: wp-content/themes/core/assets/js/editor/block-animations/index.js

QA

Links to relevant issues

Screenshots/video:

Pull request checklist

  • I've added a changelog entry for these changes.
  • I've linked to a relevant Jira issue.
  • I've captured a screenshot or screencast of the changes and linked it above.

@spadilha spadilha requested review from GeoffDusome, LayaTaal, Vinsanity, dpellenwood and jamiepaul and removed request for GeoffDusome June 24, 2026 22:12
@spadilha spadilha self-assigned this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants