Skip to content

Commit 002595b

Browse files
docs(sdk): document cascadeRemoveAnimations bare-id v1 limitation for scoped ids
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
1 parent 58987f3 commit 002595b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/sdk/src/engine/mutate.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ function selectorMatchesId(selector: string, id: HfId): boolean {
508508
);
509509
}
510510

511+
// v1 limitation: uses bare-id matching across the whole script, so a selector targeting
512+
// "hf-leaf" will cascade-remove animations for both "hf-parent/hf-leaf" and any other
513+
// element whose scoped or bare id matches "hf-leaf". Acceptable for typical single-comp
514+
// use; sub-composition authors with leaf-id collisions should use fully-qualified selectors.
511515
function cascadeRemoveAnimations(script: string, id: HfId): string {
512516
const parsedGsap = parseGsapScriptAcornForWrite(script);
513517
if (!parsedGsap) return script;

0 commit comments

Comments
 (0)