Skip to content

fix(renderer): make gesture capture leaf-first#81

Merged
re-marked merged 2 commits into
mainfrom
codex/gesture-capture-leaf-first
May 7, 2026
Merged

fix(renderer): make gesture capture leaf-first#81
re-marked merged 2 commits into
mainfrom
codex/gesture-capture-leaf-first

Conversation

@re-marked

Copy link
Copy Markdown
Owner

Summary

  • make MouseDownEvent.captureGesture(...) first-call-wins instead of last-call-wins
  • stop onMouseDown bubbling once a descendant captures the gesture, preventing ancestor Draggable wrappers from stealing it
  • add dispatcher and Draggable regression coverage plus docs/changelog updates for the new leaf-first contract

Notes

This closes the A21 semantic bug. It also improves the A3 workaround shape: a child inside <Draggable> can now claim a press with captureGesture without also calling stopImmediatePropagation().

Plain onClick inside an eagerly-capturing <Draggable> still needs A22's deferred-capture work before A3 can be fully closed.

Verification

  • pnpm test -- packages/renderer/src/events/mouse-event.test.ts packages/renderer/src/components/Draggable.test.tsx
  • pnpm --filter @yokai-tui/renderer typecheck
  • pnpm --filter @yokai-tui/renderer lint
  • pnpm test
  • pnpm --filter @yokai-tui/renderer build
  • git diff --check

Closes #71
Refs #55
Refs #72

re-marked and others added 2 commits May 7, 2026 19:31
Co-Authored-By: Mark <psyhik17@gmail.com>

Co-Authored-By: Codex <noreply@anthropic.com>
Co-Authored-By: Mark <psyhik17@gmail.com>

Co-Authored-By: Codex <noreply@anthropic.com>
@re-marked
re-marked merged commit 2aad41f into main May 7, 2026
1 check passed
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.

A21: captureGesture last-call-wins inverts every other DOM "claim" semantic

1 participant