Drag/Drop Rows

1 Answer 75 Views
Drag and Drop Grid
Janki
Top achievements
Rank 4
Bronze
Iron
Iron
Janki asked on 14 Jun 2022, 02:39 PM

Is this a bug? https://www.telerik.com/kendo-react-ui/components/grid/rows/row-reordering/#toc-kendoreact-dragdrop

If you try to drag item 4 between 1 and 2, it takes position #1 (not as expected, it should take position #2). This only happens when dragging between #1 and #2 - if you drag above #1, the row becomes #1 (as expected).

1 Answer, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 16 Jun 2022, 03:07 PM

Hello Janki,

Tank you for showing this issue to us. For some reason the findIndex() method returns -1 when the row is dropped on the second position even though the condition inside it is true for the second item when debugging it and has to return "1";

 let nextIndex = reorderedData.findIndex((p) => p === dataItem);

 

You can find an updated working version of the sample here:

https://stackblitz.com/edit/react-dtzc3g-3grf94?file=app%2Fmain.jsx

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Janki
Top achievements
Rank 4
Bronze
Iron
Iron
commented on 16 Jun 2022, 03:11 PM

Thank you for your response, Vessy! Could you get that updated in the Kendo docs at the link in my original post too? That would save a lot of people some time, I'm sure. Thanks for a great library!
Vessy
Telerik team
commented on 16 Jun 2022, 03:32 PM

Sure, Janki, I have already logged an internal task for such update :) Thank you for the kind feedback!

Tags
Drag and Drop Grid
Asked by
Janki
Top achievements
Rank 4
Bronze
Iron
Iron
Answers by
Vessy
Telerik team
Share this question
or