Skip to content

Commit a38aaea

Browse files
author
Claudéric Demers
authored
Merge pull request clauderic#123 from tomasztomys/fix-input-values
Fix inputs values.
2 parents 426311e + 0372341 commit a38aaea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/SortableContainer/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,16 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
213213
left: this.scrollContainer.scrollLeft
214214
};
215215

216-
this.helper = this.document.body.appendChild(node.cloneNode(true));
216+
const fields = node.querySelectorAll('input, textarea, select');
217+
const clonedNode = node.cloneNode(true);
218+
const clonedFields = clonedNode.querySelectorAll('input, textarea, select'); // Returns the clonedFields in the same order as fields
219+
220+
clonedFields.forEach((field, index) => {
221+
return field.value = fields[index] && fields[index].value;
222+
});
223+
224+
this.helper = this.document.body.appendChild(clonedNode);
225+
217226
this.helper.style.position = 'fixed';
218227
this.helper.style.top = `${this.boundingClientRect.top - margin.top}px`;
219228
this.helper.style.left = `${this.boundingClientRect.left - margin.left}px`;

0 commit comments

Comments
 (0)