sortablejs not working within SharePoint (webpart)

137 Views Asked by At

I have an application where items can be dragged and dropped between two lists. For this I use react-sortablejs (which uses sortablejs).

When I start my React application normally (in dev mode or deployed standalone) the drag and drop works as desired.

However, as soon as I embed the application in a SharePoint page (using webpart), the drag and drop feature starts to go haywire: the first drop works as desired, but all subsequent drops of the same item result in strange behavior, primarily duplication of the item.

After some debugging, it looks to me like the item remains in the old list and therefore an error occurs when the item is "pushed back" or a duplicate occurs because another item is pushed into the same list.

I therefore don't think that this is a problem of the library itself (also because I haven't found any similar error messages about this), but that it has something to do with SharePoint. I noticed in another context that classic context menus with absolute positioning also cause problems because event.pageX and event.pageY contain different values.

Anyway, at the moment I have no clue to get to the bottom of this problem, so I'm hoping that anyone might have had similar experiences before. Maybe this ticket will help someone else who runs into similar problems in the future.

1

There are 1 best solutions below

0
On BEST ANSWER

My problem went away after setting forceFallack to true