Merge pull request #12504 from godzzo/godzzo/issue12498

Fixing Drag ordering bug with Nested Component.
This commit is contained in:
Gustav Hansen 2022-02-15 09:01:08 +01:00 committed by GitHub
commit dfdba4fc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,10 @@ const DraggedItem = ({
if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
return;
}
// If They are not in the same level, should not move
if (dragPath.split('.').length !== hoverPath.split('.').length) {
return;
}
// Time to actually perform the action in the data
moveComponentField(pathToComponentArray, dragIndex, hoverIndex);