fix(slides): prevent sticky move after fast click - #366
Open
hamedrabah wants to merge 1 commit into
Open
Conversation
hamedrabah
force-pushed
the
fix-sticky-selection
branch
from
August 25, 2026 02:22
6f5461d to
7ef86b4
Compare
Author
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 & why
Fixes #260.
A fast single click can release while
waitToChangeTarget()is still pending. The code can then pass the stale mouse-down event to Moveable after mouse-up. Moveable starts a drag without seeing the matching release, so the selected object follows the cursor.This change installs a capture-phase mouse-up guard before the async wait. It cancels the stale handoff when release wins the race. A normal held-button drag still uses the existing path.
How I verified it
(850,170)to(1014,251)after mouse-up.(850,170).(960,223).node_modules/.bin/tsc -bsuccessfully.npm run build:singlesuccessfully.node ../scripts/shell-gate.mjs dist-single/Bento_Slides.bento.htmlsuccessfully.Checklist
npm run build:singlesucceeds (fromslides/)node scripts/test-sync.tsif I touchedslides/src/sync/(not applicable)slides/src/i18n/(no new strings)