Fix SVG zero-duration opacity animations - #3781
Conversation
Align JS and WAAPI SVG opacity updates so instant transitions cannot leave a stale inline style. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Follow-up verification correction: the Cypress launch failure was caused by
The unchecked Cypress item in the original PR description is therefore superseded by these passing runs. |
Greptile SummaryThis PR moves non-root SVG opacity rendering from presentation attributes to inline CSS so native animation completion and immediate updates write through the same channel.
Confidence Score: 4/5The implementation appears safe to merge, with a non-blocking gap in whether the new regression test actually exercises the native WAAPI path. The production change consistently routes non-root SVG opacity through CSS, but the new test's computed-style assertions can also pass under the JavaScript fallback and therefore do not fully guard the WAAPI-specific regression. Files Needing Attention: packages/framer-motion/cypress/integration/waapi-svg-zero-duration.ts Important Files Changed
Reviews (1): Last reviewed commit: "Fix #3779: keep SVG opacity rendering in..." | Re-trigger Greptile |
| .get("#chip") | ||
| .then(([$chip]: any) => { | ||
| expect(getComputedStyle($chip).opacity).to.equal("0") | ||
| }) |
There was a problem hiding this comment.
The test checks only the final computed opacity, which the JavaScript fallback also produces. It can therefore pass without exercising the SVG WAAPI completion channel and will not reliably guard the reported native-animation regression.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Move transform, opacity, and motion-path properties through one shared style-routing loop. Co-authored-by: Cursor <cursoragent@cursor.com>
Read shared SVG style properties from computed CSS with an attribute fallback, and cover svgEffect plus instant transform restoration. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
foreignObjectreproductionFixes #3779
Test plan
yarn buildyarn test(all 7 tasks; 96 Framer Motion suites and 809 tests)style.opacity = 0before the fix in Chromiumbad option: --no-sandbox/--smoke-test)yarn lint: blocked by 52 pre-existing errors in unrelated dev examples/testsMade with Cursor