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

Merge Cell feature

Open becory opened this issue 2 years ago • 3 comments

Hi @iddan,

I hope you're having a great day! I've been working with this amazing component to develop an Excel viewer, but I've encountered an issue. It seems that there isn't a merge cell feature available when using this component.

I've been attempting to create a custom component, and during this process, I noticed that the dimension state is split by both rows and columns. This makes it quite challenging to implement cell merging, as the cells are not tied to specific rows and columns. Consequently, it's not possible to use the row and column index to obtain the real dimensions of the table.

image

To address this, I merged two states and used ":" in the key to specify which column should utilize this dimension. I've also created a test for the CustomMergeCell component in Storybook to ensure that the feature works as intended and achieves the desired result.

I've come across a bug in this PR that I'm currently working hard to resolve:

The dimensions seem to be misaligned with cell positions when users zoom in and out of the page.

image

I'm still in the process of testing for other potential bugs.

I'm eagerly awaiting your reply and any assistance you can provide.

Thank you very much. Wayne

becory avatar Nov 20 '23 06:11 becory

link issue #308

becory avatar Nov 20 '23 07:11 becory

Hi @iddan,

I've come across another repository that uses classes to define selected and editing states in order to prevent floating problems during selection. You can find it at https://nadbm.github.io/react-datasheet/.

What are your thoughts on this solution?

becory avatar Nov 21 '23 15:11 becory

Hey @becory thank you so much for your work. I'm in a very busy period in my life. Unfortunately, I can't assist with it right now.

iddan avatar Dec 10 '23 10:12 iddan