react-sortablejs
react-sortablejs copied to clipboard
removeOnSpill just cause Failed to execute 'insertBefore' on 'Node':
when set removeOnSpill and remove from the sortable list, and then add one the the list . then just cause error Failed to execute 'insertBefore' on 'Node':
Hi @lidasong
Did you find a solution about this problem?
because onSpill doesn't call prop's setList, so the prop's list doesn't match the dom's list.
`<ReactSortable
list={value}
setList={onChange}
animation={200}
group={group}
removeOnSpill={true}
onSpill={evt => {
const toRemoved = value[evt.oldIndex as number];
onChange(value.filter(item => item !== toRemoved));
}}>
{value.map(item => (
<div key={item.id} className={cx({ item: true, [item.from]: true })}>
{item.caption}
</div>
))}
</ReactSortable>`