Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ogroppo
approved these changes
Nov 25, 2026
Contributor
|
Would be a nice addition to have an option to add "copy to clipboard" on desired fields |
This branch has not been deployed
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.
Problem
When a
<DataTable>or<Datagrid>row is clickable, users can't select text in a cell to copy it: releasing the mouse after dragging across a value fires a click on the row, which redirects to the record (or expands / toggles it). Copying an id or an email from a list is a common need in admin apps.Related: #10492 asked to pass the click event to
rowClickso apps could detect this themselves. This PR fixes it for everyone instead, with no change needed in apps.Solution
In
DataTableRowandDatagridRow, the row stores the text selection on mousedown, andhandleClickreturns early when the selection is non-empty and differs from it, i.e. the click selected text. Clicking text that was already selected still activates the row. Double-click selection still activates the row on the first click.How To Test
ra-ui-materialui/list/DataTable>FullAppstory withrowClickset toshow.Unit tests:
DataTable.spec.tsxandDatagridRow.spec.tsxeach check that a click that selected text doesn't callrowClick, and that a click on text selected earlier does.Additional Checks
masterfor a bugfix or a documentation fix, ornextfor a featureFullAppstory with arowClickvalue shows the behavior, so no new story was added🤖 Generated with Claude Code