fix: swap animation classes inside the iframed editor canvas by RahatSheikhLeon · Pull Request #22 · EssentialBlocks/number-counter · GitHub
Skip to content

fix: swap animation classes inside the iframed editor canvas - #22

Merged
RahatSheikhLeon merged 1 commit into
fix/animation-mutation-eventfrom
rnd/animation-mutation-event-fix
Oct 29, 2026
Merged

RahatSheikhLeon merged 1 commit into
fix/animation-mutation-eventfrom
rnd/animation-mutation-event-fix

Conversation

@RahatSheikhLeon

Copy link
Copy Markdown
Contributor

Follow-up to #18. Base is fix/animation-mutation-event, so merging this updates #18.

#18 makes the admin change handler work again, but it only looks in the outer admin document. Blocks render inside the editor-canvas iframe, so picking an animation in the inspector still does not update the block there.

Change

Testing

  • node --check passes.
  • Headless Chrome: the eb___ → eb__ class swap happens on the admin page and inside the canvas iframe.

Follow-up (not in this PR)

For the animation to play in the canvas, animate.min.css also has to load in the canvas, as accordion's block_canvas_assets() does.

🤖 Generated with Claude Code

The admin change handler only queried the outer admin document, but
blocks render in iframe[name="editor-canvas"], so picking an animation
updated nothing. Also query the canvas document and measure the
viewport against the element's own window.

Same change as accordion-toggle (fixes accordion-toggle#41). The script
shares the essential-blocks-eb-animation handle and the first plugin to
register it wins, so every copy needs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RahatSheikhLeon
RahatSheikhLeon merged commit 1974da6 into fix/animation-mutation-event Oct 29, 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.

1 participant