Skip to content
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

Issue with enableExcelCopyBuffer and Hidden Columns Causing Selection Offset #1634

Closed
5 tasks done
hwlv opened this issue Aug 7, 2024 · 2 comments · Fixed by #1651
Closed
5 tasks done

Issue with enableExcelCopyBuffer and Hidden Columns Causing Selection Offset #1634

hwlv opened this issue Aug 7, 2024 · 2 comments · Fixed by #1651
Labels
help wanted Extra attention is needed

Comments

@hwlv
Copy link

hwlv commented Aug 7, 2024

Describe the bug

When using the enableExcelCopyBuffer option set to true in slickgrid-universal, I’ve encountered an issue where selecting a range of cells causes the selection area to be offset if there is a hidden column in the grid. It appears that the hidden column is being included in the calculations, leading to discrepancies between the mouse position and the selected cells.

Reproduction

  1. Set enableExcelCopyBuffer to true.
  2. Add a column with the hidden property set to true.
  3. Attempt to select a range of cells that includes both visible and hidden columns.
image

Which Framework are you using?

React

Environment Info

| Executable          | Version |
| ------------------- | ------- |
| (framework used)    | VERSION |
| Slickgrid-Universal | VERSION |
| TypeScript          | VERSION |
| Browser(s)          | VERSION |
| System OS           | VERSION |

Validations

@ghiscoding
Copy link
Owner

cc @zewa666

@ghiscoding ghiscoding added the help wanted Extra attention is needed label Aug 8, 2024
@ghiscoding
Copy link
Owner

ghiscoding commented Aug 12, 2024

The hidden column property was something that was added not that long ago in the 6pac/slickgrid project but it is not not fully supported. The Grid Presets is much more supported to hide columns.

EDIT

I see major differences between the 2 approaches

  1. hiding a column from ColumnPicker/GridMenu/GridPresets will not create the column at all (array doesn't include hidden cols)
  2. the hidden column definition will however container all columns but skip the hidden cols (we can see below that .l6.r6 col is skipped in the DOM) (array does include hidden cols)

image

image

Another distinction is that if I do a selection from 0,0 to H3, I get a different toCell (notice below to cell 8 vs 9)

  • with hidden column definition: {"fromRow":0,"fromCell":0,"toRow":2,"toCell":9}
    • (it adds 1 more because hidden is counted in cols array)
  • hide from ColumnPicker: {"fromRow":0,"fromCell":0,"toRow":3,"toCell":8}
    • (in here it's 1 less because it's not included at all in the cols array)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
2 participants