plans/issues/issue-2578.md
<text> MotionValue children are fixed and close #2578Executor instructions: Follow this plan step by step. Run every verification command and confirm the expected result before moving on. If anything in "STOP conditions" occurs, stop and report. When done, update the status row for this plan in
plans/issues/README.md.Drift check (run first):
gh api repos/motiondivision/motion/issues/2578 --jq .state→ expectedopen. If closed, mark the README row DONE (already handled) and stop.
42bfbe3ed, 2026-06-11Reported 2024: a MotionValue passed as children to motion.text (SVG) was
serialized into a children attribute instead of updating text content,
so animated counters inside SVG never rendered. The reporter
(@simonkarman) submitted PR #2841, which was merged: commit
7c6653422 ("SVG elements (like motion.text) now update when given a
MotionValue as children, matching HTML element behavior (#2841)"), on main
since v11.13.1 (2024-12-03) — verify with
git tag --contains 7c6653422 | head -1. The issue was never closed.
Closing stale-but-fixed issues keeps the tracker honest.
packages/motion-dom/src/render/dom/DOMVisualElement.ts:42-57
(handleChildMotionValue subscribes to the children MotionValue and writes
this.current.textContent), called from
packages/motion-dom/src/render/VisualElement.ts:750-751. It sits on
DOMVisualElement, the shared base of HTML and SVG visual elements —
exactly the "moved the logic up" fix described in the issue thread.packages/framer-motion/src/render/dom/use-render.ts:51-55
(isMotionValue(children) ? children.get() : children).packages/framer-motion/src/motion/__tests__/child-motion-value.test.tsx
— including "accepts motion values as children for motion.text inside an
svg" and "updates svg text when motion value changes".useMotionTemplate output
passed to a motion.rect transform attribute rendering nothing — that
was fixed separately by commit d79e0d4ce ("Fix MotionValues rendering as
[object Object] on SVG transform attribute"), also on main.worktree-style-effect): the branch modifies
DOMVisualElement.ts (+52) but child-motion-value.test.tsx remains the
regression gate; no action needed here.| Purpose | Command (repo root) | Expected |
|---|---|---|
| Confirm fix commit on main | git merge-base --is-ancestor 7c6653422 main && echo ON-MAIN | ON-MAIN |
| Run regression tests | npx jest --config packages/framer-motion/jest.config.json --testPathPattern="child-motion-value" | all pass (4+ tests) |
| Close issue | gh api -X PATCH repos/motiondivision/motion/issues/2578 -f state=closed -f state_reason=completed | state closed |
(Note: gh issue close/gh pr edit may fail on this repo — use gh api -X PATCH as above.)
In scope: running the verification commands; posting a closing comment; closing the issue (gated — see below).
Out of scope: any source change. Do not add new tests — coverage exists.
Do not touch DOMVisualElement.ts.
Run the first two commands above.
Verify: ON-MAIN printed; Jest passes all child-motion-value tests.
Only if the plans/issues/README.md row for this plan is marked APPROVED:
gh api repos/motiondivision/motion/issues/2578/comments -f body="..."
stating: fixed by #2841 (released in v11.13.1); the secondary
useMotionTemplate-on-transform-attribute report was fixed by
d79e0d4ce; regression-tested in child-motion-value.test.tsx; please
reopen with a repro on motion@12 if it still occurs.gh api -X PATCH repos/motiondivision/motion/issues/2578 -f state=closed -f state_reason=completedIf the row is not APPROVED, mark it BLOCKED ("verified fixed; awaiting close approval") and stop.
child-motion-value Jest suite green on current mainplans/issues/README.md status row updatedgit status clean — no source files modifiedchild-motion-value test fails on main — the fix regressed; report
(this becomes a FIX plan, not a close).7c6653422 is not an ancestor of main (history rewritten — re-verify).DOMVisualElement changes ever drop handleChildMotionValue,
child-motion-value.test.tsx will catch it — do not weaken those tests.