Repository navigation
fix(docs): ignore child animation events in Promise helper - #1938
Open
nemo-crypto wants to merge 1 commit into
Open
nemo-crypto wants to merge 1 commit into
nemo-crypto wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The documented
animateCSS()Promise helper listens with{once: true}and handles every bubblinganimationend. When a nested child animation finishes before its parent, the helper removes the parent's animation classes and resolves its Promise early. It also stops the child's event from reaching other ancestors.Ignore events whose target is not the selected node, and explicitly remove the listener only after the node's own animation finishes. This preserves cleanup and the existing return value without consuming the listener on a child event. Update both the Markdown source and generated documentation.
Validation:
tests/javascript-helper.jsextracts and executes the actual documented snippet in Chromium, Firefox and WebKit. It verifies child-event propagation, no premature cleanup/resolution, parent completion, and listener removal. The test fails against the original snippet (resolved=true and parent classes removed after the child's event) and passes with the fix. These are deterministic DOM AnimationEvent tests, not physical-device tests. Also rannpm run docs:pagesandgit diff --check.To run the optional regression: install
@playwright/testwithout saving dependencies, install its three browsers, then runnode tests/javascript-helper.js.