hyperformula icon indicating copy to clipboard operation
hyperformula copied to clipboard

[Bug]: paste after cut gives not changed cells

Open doczoidberg opened this issue 1 year ago • 8 comments

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

doczoidberg avatar May 20 '24 10:05 doczoidberg

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?

adrianszymanski89 avatar May 20 '24 10:05 adrianszymanski89

sorry. now public

doczoidberg avatar May 20 '24 11:05 doczoidberg

@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.

adrianszymanski89 avatar May 20 '24 11:05 adrianszymanski89

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 });

doczoidberg avatar May 20 '24 12:05 doczoidberg

@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 avatar May 20 '24 13:05 adrianszymanski89

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.

adrianszymanski89 avatar May 21 '24 09:05 adrianszymanski89