Skip to content

Commit

Permalink
Merge pull request #123 from tomasztomys/fix-input-values
Browse files Browse the repository at this point in the history
Fix inputs values.
  • Loading branch information
Claudéric Demers authored Jan 20, 2017
2 parents 0704dfc + 235ef40 commit 5a40af7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/SortableContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit 5a40af7

Please sign in to comment.