fix(Board): always drop the selection on an in-widget control press - #1364
Merged
tenphi merged 1 commit intoAug 26, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 38a4826 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tenphi
force-pushed
the
andrew/cub-3827-board-pressing-an-in-widget-interactive-control-doesnt
branch
from
August 25, 2026 17:49
e808c06 to
38a4826
Compare
Contributor
🏋️ Size limit report
Compared against main at cc13939 — run 32876741389, 2026-08-25T17:14:44Z.To see which modules changed, download the size-limit-statoscope-report artifact from this run and open report.html. |
Contributor
📦 NPM canary releaseDeployed canary version 0.0.0-canary-c3b7b41. |
Contributor
🧪 Storybook is successfully deployed!
|
tenphi
deleted the
andrew/cub-3827-board-pressing-an-in-widget-interactive-control-doesnt
branch
August 26, 2026 09:36
Merged
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.
Fixes CUB-3827.
selectionCancelpromises that pressing an interactive descendant of a widget drops the board selection, but the reset rode on the widget host's bubble-phaseonPointerDown— so it only happened for presses that actually reached the host. A control that callsstopPropagation()first never got there, which is why a widget's gear/leaf button dropped the selection while the chart's mapping button and an inline delete button silently left it standing.What changed
WidgetHost— the reset moved out ofhandleSelectPointerDowninto two capture-phase handlers that only read the target (nothing is stopped or prevented, so every control keeps its press, focus and default behaviour):onPointerDownCaptureon the host. Capture runs top-down, so it lands before any descendant can callstopPropagation(), and because React propagates along the React tree it also covers a control the widget rendered into a portal (a menu opened from a widget's toolbar).commit.Board— the marquee no longer starts from a press on content a widget portaled outside the board. React events arrive from portals along the React tree, so a press in a popover over the board used to be able to open a lasso behind it.selectionCancelnow states the guarantee holds however the control handles the press.Tests
Three regression specs under
selection > clearing > however the press reaches the widget, one per way a press can miss the host: ReactstopPropagation, nativestopPropagation, portaled control. All three fail onmainand pass here.pnpm test(2110 passed) andpnpm test:browser(127 passed) are green.🤖 Generated with Claude Code
Note
Low Risk
Localized pointer-event ordering in Board selection/marquee; behavior is additive (clear selection earlier) with tests and no API changes.
Overview
Fixes CUB-3827: pressing a
selectionCancelcontrol inside a widget now always clears the board selection, including when the control stops propagation (React Aria, chart toolbars) or renders in a portal.WidgetHostmoves selection clearing out of bubble-phaseonPointerDowninto capture handlers that only inspect the target—nostopPropagationorpreventDefault, so buttons and inputs keep normal press/focus behavior. A ReactonPointerDownCaptureruns before descendants can block the event and still sees portaled UI in the widget’s React tree; a nativepointerdowncapture listener on the host covers libraries that stop the native event before React runs.Boardignores marquee starts when the pointer target is outside the board content DOM, so a press on a portaled overlay no longer draws a lasso behind it.Docs and regression tests cover React
stopPropagation, nativestopPropagation, and portaled controls.Reviewed by Cursor Bugbot for commit 38a4826. Bugbot is set up for automated code reviews on this repo. Configure here.