Skip to content

Commit

Permalink
fix: NodeList.forEach is undefined in certain browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic committed Jan 20, 2017
1 parent 92f4c26 commit 0b52d14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SortableContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f

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
const clonedFields = [...clonedNode.querySelectorAll('input, textarea, select')]; // Convert NodeList to Array

clonedFields.forEach((field, index) => {
return field.value = fields[index] && fields[index].value;
Expand Down

0 comments on commit 0b52d14

Please sign in to comment.