Skip to content

Commit cb370d0

Browse files
committed
Fix inputs values.
1 parent 0704dfc commit cb370d0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/SortableContainer/index.js

Lines changed: 10 additions & 1 deletion
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 nodeCloned = node.cloneNode(true);
218+
219+
fields.forEach((field) => {
220+
const element = nodeCloned.querySelector("input[name='"+field.name+"'], textarea[name='"+field.name+"'], select[name='"+field.name+"']");
221+
element ? element.value = field.value : null;
222+
});
223+
224+
this.helper = this.document.body.appendChild(nodeCloned);
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)