Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The node before which the new node is to be inserted is not a child of this node. #1028

Open
VladSalat666 opened this issue Feb 16, 2021 · 0 comments

Comments

@VladSalat666
Copy link

VladSalat666 commented Feb 16, 2021

Hello, got an error tried to reorder items.

Tried fixing CSS(pointer-events: none;) and it didn't help.

Tried to use both [(dragulaModel)] and [dragulaModel] with dropModel event listener options and got the same errors
ERROR DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

Code example:

items is an objects

<table>
...
<tbody dragula="group" [(dragulaModel)]="items">
<tr *ngFor="let item of items">
<td class="handle">...</td>
...
</tr>
</tbody>
</table>

Group options:

{
  revertOnSpill: true,
  removeOnSpill: false,
  copySortSource: true,
  moves(handle): boolean {
    return handle.className.includes('handle');
  }
}

UPD:

Got error only on those containers where a copy func returns true and reordering enabled

{
  revertOnSpill: true,
  removeOnSpill: false,
  copySortSource: true,
  moves(handle): boolean {
    return handle.className.includes('handle');
  },
  copy(source): boolean {
    return source.id === 'copy-us',
  }
}

So in this case, after reordering in the container with id 'copy-us' it throws an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant