plotly / react-pivottable

React-based drag'n'drop pivot table with Plotly.js charts
https://react-pivottable.js.org/
MIT License
972 stars 248 forks source link

Drag and drop fields from one axis to another will duplicate them in React 18 #150

Closed ianldgs closed 1 year ago

ianldgs commented 2 years ago

https://user-images.githubusercontent.com/6526498/176625436-4b45ccd1-6a76-4efb-a1d7-00e30c344ade.mov

We are willing to send a PR to fix this, as we are heavy users of this library at IMC. It's likely a bug with an older version of react-sortablejs or react-draggable.

Would anyone be able to review it? Haven't seen anyone responding to issues lately.

bell-ho commented 1 year ago

I have the same problem, have you solved it?

ianldgs commented 1 year ago

Yes. I rewrote the drag and drop logic with dnd-kit.

Since I got no response about someone being able to review it, I just cloned it and published to our private npm repo.

ianldgs commented 1 year ago

@bell-ho I don't think it's rude, no. But I have to check with the legal dept of the company, don't wanna get in trouble 😄 We also have plans to open source this kind of stuff, so I think it will be fine, but will get back to you.

bell-ho commented 1 year ago

@ianldgs Thank you for your consideration. I'll try customizing it until I get an answer.

ianldgs commented 1 year ago

I've published a package with the fixes: https://www.npmjs.com/package/@imc-trading/react-pivottable

For now, we don't have a github repo, because it's published from our internal monorepo. But you can inspect the output on one of the following websites:

bell-ho commented 1 year ago

@ianldgs Thank you very much. It will be applied to the project. It's been such a big help. Thank you again.