silevis / reactgrid

Add spreadsheet-like behavior to your React app

Home Page:https://reactgrid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not insert data correctly from Excel into Windows

Unilfo opened this issue · comments

Describe the bug
The bug is reproduced on Windows. When inserting multiple values.

Current behavior
I am attaching a photo.
in the handlePaste function where we remove where the array is iterated, we need to check for an empty value
https://github.com/silevis/reactgrid/blob/develop/src/lib/Functions/handlePaste.ts#L39

Expected behavior
values ​​are inserted correctly

Screenshots or gifs
Снимок экрана 2023-12-20 в 19 05 37
Снимок экрана 2023-12-20 в 19 06 10

Your environment details

  • Device: [e.g. mobile/desktop]
  • OS: [e.g. iOS]
  • Browser [chrome]

Hi! We have a trouble understanding this issue - could you provide a short recording explaining the steps you take and their effect in ReactGrid as well as showing what should happen?

If I understood you correctly, the mechanism you're expecting works like this:

  1. ReactGrid checks the size of the selection.
  2. It aligns the data layout (e.g., from left to right) to the selection.
  3. It pastes the data, and when it reaches the end of the horizontal selection, it moves to the next row (first column) and pastes the next set of data.

BUT what if:

  • data is bigger than selection?
  • data is bigger than grid?
    What sort of behavior do you expect?

Certainly.
There are 2 problems.
First. When inserting values ​​from excel, the last empty value is inserted.
Second. After insertion, the grid size is not determined correctly.(highlights)

If you give me your email, I will send you a short video.
Thank you

Post it here or on Youtube, please.

The logic should be handled by you. You may ask why, and I will answer...
Becasue some users may want grid to expand if number of pasted columns is bigger that numbers of columns in grid. What should happen? Should grid expand by creating new columns and paste data into them? Or maybe data should be trimmed, so some of pasted-columns won't find way to grid, and data will be lost?
And that is just one problem. Many other problems may arise from feature you are requesting.

You have to create parse-from-excel logic on your own. If it will fit many different purposes of other users, we may add it to core.