fix: cancel timeline clip interactions when the pointer stream is interrupted#135
Merged
Conversation
|
🎉 This PR is included in version 2.13.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What
A timeline clip drag could stick to the cursor. If the browser never delivered
pointerup(for example, releasing over a native context menu, switching apps mid-drag, or a touch scroll takeover), the interaction state machine remained indragging, so every subsequent hover move kept repositioning the clip. Clicking to recover could start a new interaction over the stale one, leaving the clip stranded atposition: fixedwithpointer-events: noneuntil a re-render.How
pointercancel, or any move without the primary button held, cancels the interaction: the clip is restored to its original position, the ghost is removed, and no command is executeddispose()touch-action: noneon clips stops the browser from reclaiming touch drags for scrolling (empty track area still scrolls)Verify
Normal drag/drop/resize behaviour is unchanged: 29 unit tests (8 new), plus drag-and-drop and drag-cancel exercised in-browser on this branch. To reproduce the lost
pointerupdeterministically, paste this in the console on any page showing the timeline — no manual dragging needed:Verified on 2.13.0: prints BUG and the clip visibly chases the real mouse. On this branch: prints FIXED and the clip snaps back to its original position with no edit applied.