handsontable / hyperformula

HyperFormula is an open-source headless spreadsheet for business web apps. It comes with over 400 formulas, CRUD operations, undo-redo, clipboard support, and sorting.
https://hyperformula.handsontable.com/
GNU General Public License v3.0
1.88k stars 107 forks source link

[Bug]: paste after cut gives not changed cells #1411

Open doczoidberg opened 1 month ago

doczoidberg commented 1 month ago

Description

Pasting after cutting cells does not give the changed cells back as described in the documentation.

example:

https://codesandbox.io/p/devbox/dawn-sunset-4pqrpt?file=%2Fsrc%2Fui.js%3A46%2C49

Video or screenshots

No response

Demo

https://codesandbox.io/p/devbox/dawn-sunset-4pqrpt?file=%2Fsrc%2Fui.js%3A46%2C49

HyperFormula version

2.7

Your framework

No response

Your environment

mac or windows

adrianszymanski89 commented 1 month ago

Hi @doczoidberg

Thank you for contacting us. I wanted to check the issue, but I don't have permission to view the sandbox you sent. Can you please change the access rules?

doczoidberg commented 1 month ago

sorry. now public

adrianszymanski89 commented 1 month ago

@doczoidberg

The documentation says that using paste() right after cut() behaves the same as moveCells(), which is what we can observe in your example, as you are pasting the second row in the place of the first. It seems to work as intended.

doczoidberg commented 1 month ago

but how can I get the changed cells after the pasting?

I need all changes (could also be changed references)

Documentation also says:

// returns a list of modified cells: their absolute addresses and new values
const changes = hfInstance.paste({ sheet: 0, col: 1, row: 0 });
adrianszymanski89 commented 1 month ago

@doczoidberg

I asked our HyperFormula developer for clarification on this, as it's not clear if that's the correct behavior. I'll update you once I have feedback from him.

adrianszymanski89 commented 1 month ago

Hi @doczoidberg

I just got confirmation from our developer that this is indeed a bug, and the description in the documentation might be misleading. I'll update you once we fix this.