Repository navigation
fix(ui): image preview no longer blocks clicks after closing - #57324
Merged
Merged
Conversation
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.
Problem
After closing the image preview, clicks on the timeline did nothing for a while (about 1 s at the shipped spring, about 4 s with slow motion on).
The preview keeps its Kobalte content mounted through the closing flight, using a CSS animation that runs for
--image-preview-exit. #56997 raised that hold from 1800 to 3200 ms per second of spring. While the content stays mounted:bodyatpointer-events: none. It restores pointer events only when a modal layer's content unmounts.pointer-events: auto, so it catches clicks over the middle of the page.On beta, 300 ms after Esc,
document.elementFromPointover the page text returnedDIV[data-slot=image-preview-body], withbody.style.pointerEvents === "none".Fix
image-preview.css: closed content takes no pointer events, andbodytakes pointer events again as soon as the close starts. The flight looks the same.motionTuning.springtakes an optionalshippedpreset. The Motion strip now shows Shipped, Snappy, Smooth and Calm, so every preset stays selectable.Tests
packages/app/component-tests/image-preview.spec.ts. It closes the preview by Esc, by a backdrop click, by the close button, and mid-flight, then clicks the page straight away with a raw click. All four tests fail on beta and pass here.motion-tuning.test.tscovers a spring that ships a named preset.