fix: ensure slideout cleanup completes without transition events - #19511
Merged
brandonkelly merged 3 commits intoAug 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reliable fallback cleanup when slideout transition events are missing.
Changes:
- Tracks and cancels transition fallback timers.
- Completes transitions once via event, timeout, or immediate reduced-motion handling.
- Adds Playwright coverage for cleanup and rapid reopening.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/web/assets/cp/src/js/Slideout.js |
Implements resilient, cancellable transition completion. |
tests-playwright/tests/slideout/index.test.js |
Tests completion, fallback, reopening, and reduced motion. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
# Conflicts: # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
[ci skip]
Member
|
Thanks! |
Member
|
Craft 5.11.0 is out with this change. Thanks again! |
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.
Description
Make
Slideouttransition completion resilient when reduced motion is disabled but an expected transition event never arrives: retain the event-driven path, add a duration-aware fallback that invokes each completion callback exactly once, and treat targets with no effective transition as immediately complete. Track fallback work with the existing transition listeners so_cancelTransitionListeners()cancels both parts when a slideout is reopened or rapidly toggled; this prevents an obsolete close callback from hiding the active shade or container. Keep this logic inside the existing production-used_afterTransition()lifecycle rather than introducing a test-only seam, and preserve the current shade fade and container motion when events fire normally.Craft.Slideout.close()hides its shade and outer container only from callbacks registered by_afterTransition(). When a browser does not emit the expectedtransitionend, those callbacks remain pending, leaving an invisible, full-viewport shade withdisplay: blockand active pointer events, and preventing the slideout's close lifecycle from finishing. The thread now includes a deterministicCraft.Slideoutreproduction on Craft 5.10.13.2 and identifies the missing transition event, although the maintainer could not reproduce it in the same browser version and requested a safe-mode check. There are no assignees, competing PRs, or closed prior attempts in the supplied issue evidence.Fixes #9912
Related issues
Not applicable to this change.