hoist-react icon indicating copy to clipboard operation
hoist-react copied to clipboard

"Copy" context menu item behavior for Total rows inconsistent with other rows

Open febbraiod opened this issue 2 years ago • 6 comments

Reported by client QA team. The copy menu item for regular rows puts the whole in your clipboard. While for total rows it only grabs the cell you are right clicking on.

febbraiod avatar Apr 21 '22 15:04 febbraiod

Almost certainly an ag-grid bug - if it comes up again in QA we can confirm look for a record of it on their side. @saba-mo did check and this is not a new v27 bug.

amcclain avatar Apr 21 '22 18:04 amcclain

I know they have been working on the clipboard in latest release -- would be interesting to see if this has been fixed.

lbwexler avatar Jun 10 '22 14:06 lbwexler

It looks like this is a limitation of pinned rows, and doesn't appear to be fixed in the current release. Worth attempting to come up with our own workaround? Or filing a ticket with ag-grid directly?

ghsolomon avatar Jun 10 '22 20:06 ghsolomon

we should file this with ag-grid, I think

On Fri, Jun 10, 2022 at 4:19 PM Greg Solomon @.***> wrote:

It looks like this is a limitation of pinned rows, and doesn't appear to be fixed in the current release. Worth attempting to come up with our own workaround? Or filing a ticket with ag-grid directly?

— Reply to this email directly, view it on GitHub https://github.com/xh/hoist-react/issues/2967#issuecomment-1152707796, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARTL2NN6TA3L7DWHUI2DMLVOOPOBANCNFSM5T7VZMYA . You are receiving this because you commented.Message ID: @.***>

lbwexler avatar Jun 11 '22 15:06 lbwexler

Sounds good- after looking at this a little more, it does seem to be a documented limitation:

Clipboard "When Row Selection is enabled by setting gridOptions.rowSelection to either "single" or "multiple", then copying while a row is selected will add the whole row's contents to your clipboard."

Row Pinning "Pinned rows are not part of the main row model. For this reason, the following is not possible: Row Selection: Pinned rows cannot be selected."

Will message you separately about filing with ag-grid

ghsolomon avatar Jun 13 '22 13:06 ghsolomon

AG-Grid feature request: https://www.ag-grid.com/pipeline/?searchQuery=AG-2339

Potential intermediate approaches:

  • Use range selection to copy the pinned row which is currently supported
  • Take control of the clipboard and implement logic to check whether a cell being copied is part of a pinned row or a regular row, retrieve the data and copy it to the clipboard, like in this example

ghsolomon avatar Jun 23 '22 15:06 ghsolomon