diff --git a/packages/core/admin/admin/src/content-manager/components/RepeatableComponent/components/Component.js b/packages/core/admin/admin/src/content-manager/components/RepeatableComponent/components/Component.js index aca74533b5..249db3fcad 100644 --- a/packages/core/admin/admin/src/content-manager/components/RepeatableComponent/components/Component.js +++ b/packages/core/admin/admin/src/content-manager/components/RepeatableComponent/components/Component.js @@ -97,11 +97,17 @@ const DraggedItem = ({ const accordionRef = useRef(null); const { formatMessage } = useIntl(); - const [parentFieldName] = componentFieldName.split('.'); + /** + * The last item in the fieldName array will be the index of this component. + * Drag and drop should be isolated to the parent component so nested repeatable + * components are not affected by the drag and drop of the parent component in + * their own re-ordering context. + */ + const componentKey = componentFieldName.split('.').slice(0, -1).join('.'); const [{ handlerId, isDragging, handleKeyDown }, boxRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(!isReadOnly, { - type: `${ItemTypes.COMPONENT}_${parentFieldName}`, + type: `${ItemTypes.COMPONENT}_${componentKey}`, index, item: { displayedValue,