Skip to content

feat(List): let the item and row text be selected and copied - #3097

Draft
Lisa18289 wants to merge 2 commits into
nextfrom
claude/list-item-select-click-1710d4
Draft

feat(List): let the item and row text be selected and copied#3097
Lisa18289 wants to merge 2 commits into
nextfrom
claude/list-item-select-click-1710d4

Conversation

@Lisa18289

@Lisa18289 Lisa18289 commented Sep 2, 2026

Copy link
Copy Markdown
Member

A ListItem and a table row are click targets, and React Aria sets
user-select: none on them while pressing, so their text could never be
selected. The item's title and subtitle and the table's cells now opt back in.

Dragging never activates an item, whether or not it selected text — React Aria
triggers the press from the click event, so selecting a heading would otherwise
activate the item, and a drag that missed the text would navigate away rather
than do nothing. An ordinary click still activates it, including one that
wobbles a few pixels or lands inside an existing selection. Drags starting on an
interactive child, and clicks arriving without a pointer interaction (keyboard,
screen reader), are left alone.

The title box hugs its text exactly, so a drag would have had to hit the text
pixel for pixel. The header around it is selectable as well, and the title
carries padding cancelled out by the same negative margin, so a drag can start
beside the text without moving it. Verified against Storybook: six stories,
including the long-word edge case, render byte-identical.

Depends on #3066. WebKit has no unprefixed user-select, so without
autoprefixer the rule does not apply in Safari and the webkit browser project
fails six tests. Merge that first, then update this branch — with the prefix in
place locally the whole components browser suite is green (548 tests).

The drag tests live in a new browser-mouse vitest project. Only a native drag
creates a real text selection, and parallel test files share one page and one
Playwright cursor, so another file's click releases the held button mid-drag.

The cursor over the text stays pointer. Making it text would weaken the
"this whole row is clickable" affordance, so that is a UX call rather than part
of this change.

Closes #895

🤖 Generated with Claude Code

@Lisa18289 Lisa18289 added the run-visual-tests Runs the full visual regression suite against the existing baselines and fails the check on mismatch label Sep 2, 2026
@Lisa18289 Lisa18289 self-assigned this Sep 2, 2026
@github-actions github-actions Bot removed the run-visual-tests Runs the full visual regression suite against the existing baselines and fails the check on mismatch label Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6592 for commit 7e010e8 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3097.docs.review.flow-components.de
storybook pr-3097.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3097
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3097

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

❌ Visual Regression Tests Failed

At least one shard did not pass. If snapshots differ from the committed baselines, download the visual-diffs-* artifacts from this run to inspect the actual/diff images (a shard that failed before comparison, e.g. during install or browser setup, leaves none).

If the differences are intentional, update the baselines by adding the update-screenshots label to the PR.

Run details

@Lisa18289
Lisa18289 force-pushed the claude/list-item-select-click-1710d4 branch 2 times, most recently from d179976 to b04003e Compare September 2, 2026 11:44
@Lisa18289
Lisa18289 changed the base branch from main to next September 2, 2026 13:38
@Lisa18289
Lisa18289 force-pushed the claude/list-item-select-click-1710d4 branch 3 times, most recently from 22a6a7f to 05222a0 Compare September 3, 2026 11:13
Lisa18289 and others added 2 commits September 3, 2026 13:15
A ListItem and a table row are click targets, and React Aria sets
`user-select: none` on them for the duration of a press, so their text could not
be selected. The item's title and subtitle and the table's cells now opt back
in, and the click that ends a mouse drag is swallowed in the capture phase —
React Aria triggers the press from the click event, so selecting a heading would
otherwise activate the item as well.

Dragging never activates an item, whether or not it selected text: a drag that
missed the text would otherwise navigate away rather than do nothing. A click
that changed the text selection is swallowed regardless of distance, which
covers selecting a single character and selecting by long press on touch.

An ordinary click still activates the item, including one that wobbles a few
pixels or lands inside an existing selection, where the browser keeps the
selection alive until after the click. A drag that started on an interactive
child is left alone, as is any click arriving without a pointer interaction —
keyboard, screen reader, `element.click()`.

The title box hugs its text exactly, so a drag would have had to hit the text
pixel for pixel. The header around it is selectable as well, and the title
carries padding cancelled out by the same negative margin, so a drag can start
beside the text without moving it.

Only a native drag creates a real text selection, and every parallel test file
shares one page and one Playwright cursor, so another file's click releases the
held button mid-drag. The `browser-mouse` project gives those tests a page of
their own, one file at a time.

Needs #3066 to work in Safari: WebKit has no unprefixed `user-select`, so
without autoprefixer the rule does not apply there and the webkit browser
project fails.

Closes #895

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lisa18289
Lisa18289 force-pushed the claude/list-item-select-click-1710d4 branch from 05222a0 to 17cc149 Compare September 3, 2026 11:15
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.

Copy content of the list

1 participant