Repository navigation
fix(docs): restart the latest selected playground animation - #1940
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.
Selecting an animation while another preview is still running leaves both animation classes on the title. CSS source order then determines what plays, rather than the user's latest selection. For example, selecting pulse during the zoomInDown intro keeps playing zoomInDown; selecting bounce while pulse is running also leaves pulse in control. Re-selecting the current animation does not restart it.
Cache the animation classes represented by the list, remove them before each selection, and flush that removal before adding the requested class. This also handles interruption of the intro animation and replay of the same animation. The synchronous layout read is limited to the preview target on an explicit selection, not an animation-frame loop.
Validation:
tests/playground-restart.js, which uses the actual stylesheet and playground module with real browser CSS animations.node --check docs/modules/playground.mjsandgit diff --checkpass.Run the optional test after installing
@playwright/testand its browsers:node tests/playground-restart.js. No physical devices were tested. This is independent of the keyboard-control change in #1939 and works with the existing span markup.