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

Cell Range ctrl-c and ctr-v strange behavior when column bottomCalc option is added #4522

Open
guidry opened this issue Jun 17, 2024 · 1 comment
Labels
Possible Bug A possible bug that needs investigation

Comments

@guidry
Copy link

guidry commented Jun 17, 2024

Describe the bug
Cell Range Ctrl-C and Ctr-V produce strange behaviour when column bottomCalc option is added. I tested it with the demo of Range Clipboard on https://tabulator.info/docs/6.2/range section , when there is no bottomCalc option added is OK as the demo shows, but if you add bottomCalc option to the column definition, it will also copy the footer which is the bottomCalc value to the clipboard. And if you ‘paste to fill’ the other cell, it will fill the cell under the cell you want to paste with the bottomCalc value ( for example sum ) which is very strange. What we expect should be the same like what Excel does. Would you please fix that problem? Thank you.

Tabulator Info
Version 6.2.1
Working Example
A little modification of the demo of Range Clipboard on https://tabulator.info/docs/6.2/range section with bottomCalc option added. AS shown in this jsfiddle page:
jsfiddle page
The screen shots:
Ctrl-C
fiddle1

Ctr-V
fiddle2

To Reproduce
1.Range select the second column of the first row(the value is 12).
2. Press Ctrl-C.
3. Select the second column of the second row(the value is 1).
4. Press Ctrl-V.
5. You will see the value of the second column of the second row is 12 which is correct, but the value of the second column of the third row becomes 407(the sum of this column) which is not what we want.

Expected behavior
The cell value under the cell we want to paste or fill to will not be affected.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu Linux, Windows 10
  • Browser :Firefox , Chromium
  • Version: 125.0.2 , 125.0.6422.141
    Additional context
    Add any other context about the problem here.
@guidry guidry added the Possible Bug A possible bug that needs investigation label Jun 17, 2024
@guidry
Copy link
Author

guidry commented Jun 19, 2024

After taking a look into the Tabulator source code, I finally found that we need to set columnCalcs flag to false in the clipboardCopyConfig option , for example
clipboardCopyConfig:{ rowHeaders:false, columnHeaders:false, columnCalcs:false //*** You have to explicitly add this }
Because columnCalcs flag is not explicitly mentioned in Range Clipboard section of the documentation, I think it would be better to add this to documentation to reduce confusion and prevent this issue from happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Bug A possible bug that needs investigation
Projects
None yet
Development

No branches or pull requests

1 participant