Skip to content

fix(fx-runtime): section-level data-fx never initialized - #26

Open
Ynchnnnn wants to merge 1 commit into
lewislulu:mainfrom
Ynchnnnn:fix/section-level-data-fx
Open

fix(fx-runtime): section-level data-fx never initialized#26
Ynchnnnn wants to merge 1 commit into
lewislulu:mainfrom
Ynchnnnn:fix/section-level-data-fx

Conversation

@Ynchnnnn

@Ynchnnnn Ynchnnnn commented Jul 9, 2026

Copy link
Copy Markdown

Problem

initFxIn / stopFxIn look up effect targets with root.querySelectorAll('[data-fx]') — but querySelectorAll never matches the root element itself. So data-fx placed directly on a <section class="slide"> (the natural way to give a cover slide a canvas background) was silently ignored: no canvas mounted, no handle in __hpxActive.

Fix

Add a small fxEls(root) helper that includes the root when it carries data-fx, and use it in both initFxIn and stopFxIn so the lifecycle stays symmetric.

Verification

  • A cover slide with data-fx="starfield" now mounts its canvas on activation (__hpxActive holds the handle) and stops when the slide leaves.
  • Descendant [data-fx] elements behave exactly as before.

🤖 Generated with Claude Code

initFxIn/stopFxIn use root.querySelectorAll('[data-fx]'), which never
matches the root element itself — so data-fx placed directly on a
<section class="slide"> (the documented way to give a cover slide a
canvas background) was silently ignored: no canvas, no handle in
__hpxActive.

Add fxEls() that includes the root when it carries data-fx, and use it
in both init and stop so lifecycle stays symmetric.

Verified: a cover slide with data-fx="starfield" now mounts its canvas
on activation and stops on leave; descendant [data-fx] behavior unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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