Skip to content

[bug] Problem with destroy and create #2036

Open
@sydesb

Description

@sydesb

Describe the bug

When I use destroy and create on the fly, it ends with an error: Uncaught TypeError: sortable [expando] is null

Here is my goal:

  • I have questions that are in several groups.
  • A question can change group.
  • The order of the groups may change.
  • A new group is created if we move a question outside groups that already exist.
  • An empty group must disappear.

I made it and everything is fine except when a group is empty of its last question. The empty group is deleted, but the following move crashes everything: "Uncaught TypeError: sortable [expando] is null"

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codepen.io/sylv20/pen/vYxOgVo
  2. Click on quest3d to put it in another group. Then, move any question and look at your console (not the console of codepen.io)
  3. In your console : "Uncaught TypeError: sortable [expando] is null"

Information

sortablejs = 1.13.0

Reproduction
codesandbox: https://codepen.io/sylv20/pen/vYxOgVo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions