Conversation
|
It seems to be related to the CSS property we use on the column and row headers: user-select: none;In this case, Ctrl+C does not target the cell, and the last targeted cell will be used. I guess it's because it's the one that contains the document "selection". Also, see https://developer.mozilla.org/en-US/docs/Web/API/Selection#selection_and_input_focus and https://developer.mozilla.org/en-US/docs/Web/API/Selection#behavior_of_selection_api_in_terms_of_editing_host_focus_changes. The relation between focus and selection is not totally standard across browsers. I think the most acceptable solution for now is to allow selecting text in column and row headers, so that the cells can be copied. wdyt @platypii? |
…he copy is on another cell" This reverts commit 6132aae.
|
Note that I reverted the first solution I tried, that was not a good fix at all: 6132aae. It was the reason of the previous test failure. |
platypii
left a comment
There was a problem hiding this comment.
Nice, this is great for quick copying of data (eg- to paste into chatgpt).
I agree with removing user-select: none from the headers. First of all, sometimes I do want to be able to copy that header text. Also we don't need to be so opinionated about that css: let downstream users decide if its selectable or not.
fixes #302
Screencast.From.2025-10-17.17-48-20.mp4
I still have a bug that I don't understand... Possibly not related to the clipboard, but I just noticed in this PR: when I focus outside of the app, then when I click a row header or a column header, it gets the focus (as far as I could check), but the copy event is done on the last focused cell, not the new one. I don't get why yet.
Screencast.From.2025-10-17.17-50-07.mp4