diff --git a/src/SortableContainer/index.js b/src/SortableContainer/index.js index 3dc5eaca0..a55e54db0 100644 --- a/src/SortableContainer/index.js +++ b/src/SortableContainer/index.js @@ -213,7 +213,16 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f left: this.scrollContainer.scrollLeft }; - this.helper = this.document.body.appendChild(node.cloneNode(true)); + const fields = node.querySelectorAll('input, textarea, select'); + const clonedNode = node.cloneNode(true); + const clonedFields = clonedNode.querySelectorAll('input, textarea, select'); // Returns the clonedFields in the same order as fields + + clonedFields.forEach((field, index) => { + return field.value = fields[index] && fields[index].value; + }); + + this.helper = this.document.body.appendChild(clonedNode); + this.helper.style.position = 'fixed'; this.helper.style.top = `${this.boundingClientRect.top - margin.top}px`; this.helper.style.left = `${this.boundingClientRect.left - margin.left}px`;