Skip to content

Resolve #3508978 "Listed item for"

Closes #3508978

Problem:

I think what's happening is when an item is dragged out of the Components list, a clone from SortableJS replaces it in the list. But that clone doesn't have any of the React event handlers that the original item had. So for example the component preview no longer works onMouseEnter, for all the components, not just code components.

So that's why it works when you close and re-open the Components list, since in that state, only the originals are there due to re-rendering, no clones.

Solution: Generate a unique key in onDragEnd() and pass into component as a key so it re-renders the list with the React event handlers attached :). This bug fix applies to both the components list and the sections list. Thought about adding it to the DynamicComponentsList too but that menu closes when the drag finishes so we don't encounter the bug.

Edited by Harumi Jang

Merge request reports

Loading