-
-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reordering panels using dnd-kit #126
Comments
I am happy to hear that this library has been working well for you 😄 Ah, that is an interesting challenge. To simplify the API of this library, I choose to have a panel group automatically associate drag-handles with panels based on the order they're declared in. I think you could improve the UX of your Sandbox a little bit by adding {items.map((item, index) => {
return (
<Fragment key={item}>
<Panel
id={`${item}`}
order={index}
style={{ overflow: "initial", minWidth: 0 }}
> But there would still be an unpleasant size "jump" when dragging starts, because I didn't write panel group with the expectation that panel ordering may change within a group. I think supporting this properly would require adding an imperative API to
I don't think I have time to make the imperative API change to |
Imperative API added for I think you should be unblocked to do what I suggested above, now. |
Thanks you, that was really fast! |
No problem! 😄 If your company has been finding this library useful in your work– consider becoming a sponsor |
Hey, I really apreciate the effort that has been made for this library. It is really life changing for me and my team in creating highly interactive UI. One of the requirements for my project is to be able to reorder the panels horizontally.
On the first implementation I've managed to make it work, but when I change the order of them the drag handle no longer works properly, because the ids didn't change. One fix would be to use the index for the order when mapping but this would trigger some flashes.
https://codesandbox.io/s/runtime-thunder-q2nhos?file=/src/WidgetGroup.tsx:1157-1469
runtime-thunder-q2nhos.-.CodeSandbox.mp4
The text was updated successfully, but these errors were encountered: