-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when cell_selectable=False table text cannot be copied to the clipboard in data table #1978
Comments
I did a bit of digging and it looks like the issue is that the I'm wondering if what's needed is for the copy event handling logic to opt-out of using the DataTable's copying machinery and defer to the browser's default handling? @alexcjohnson is this something we could address with a relatively small change? If so I'd be up for trying to put together a PR. Or is this opening a broader question that needs untangling first? |
@ned2 thanks for the investigation! (and apologies for the slow reply, this came in during a vacation and then slipped off my radar 🙈 ) I think you're right that these events should just revert to the browser when |
@ned2 thanks for your hints, I have created a pull request that solves this issue: #2114 @alexcjohnson I'd be very happy to get some feedback on it from you, particularly since this is my first PR for dash 🙂 |
Will copy/paste of partial cell content be fixed with this PR too, or will it still be a separate issue? |
@AnnMarieW the fix from the PR will only affect copy/paste behavior in situations where no cell has been selected, so I assume it will not (completely) fix the issue you mentioned. However, feel free to try it out yourself: the fix has already been included in the latest dash release 👍 |
Describe the bug
When a
DataTable
is initialised withcell_selectable=False
, text cannot be copied to the clipboard. This is independent of the issue in #1975 where cells in columns withpresentation
value ofinput
do not appear to be visually selected. The text can actually be selected, however when attempting to copy the selection, nothing is added to the clipboard.Expected behavior
When
cell_selectable
is false, text selected inside DataTable cells should be able to be copied to the clipboard as is normally handled by the browser.Minimal Example
Text in any cell (regardless of
presentation
) cannot be copied to the clipboard.Environment
The text was updated successfully, but these errors were encountered: