Skip to content

fix(slides): prevent sticky move after fast click - #366

Open
hamedrabah wants to merge 1 commit into
nyblnet:mainfrom
hamedrabah:fix-sticky-selection
Open

fix(slides): prevent sticky move after fast click#366
hamedrabah wants to merge 1 commit into
nyblnet:mainfrom
hamedrabah:fix-sticky-selection

Conversation

@hamedrabah

Copy link
Copy Markdown

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

  • Reproduced the unpatched failure with a real browser mouse. The object moved from (850,170) to (1014,251) after mouse-up.
  • Ran 30 fast-click trials against the patch. All 30 kept the object at (850,170).
  • Verified that a deliberate held-button drag still moved the object to (960,223).
  • Ran node_modules/.bin/tsc -b successfully.
  • Ran npm run build:single successfully.
  • Ran node ../scripts/shell-gate.mjs dist-single/Bento_Slides.bento.html successfully.

Checklist

  • Read the relevant parts of CLAUDE.md / docs before changing them
  • npm run build:single succeeds (from slides/)
  • Ran node scripts/test-sync.ts if I touched slides/src/sync/ (not applicable)
  • New UI strings added to every catalog in slides/src/i18n/ (no new strings)
  • Document format changes are additive and backward-compatible (no format change)
  • Did not bump the version or cut a release (maintainers sign releases)

@hamedrabah
hamedrabah force-pushed the fix-sticky-selection branch from 6f5461d to 7ef86b4 Compare August 25, 2026 02:22
@hamedrabah

Copy link
Copy Markdown
Author

@nyblnet, could you review this focused fix for #260 when convenient? The change is limited to preventing drag activation after a completed click, with browser regression verification documented in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selecting an object with single click sometimes causes sticky move

1 participant