Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[bug] Fallback mode includes cloned element in toArray #2456

Copy link
Copy link
@juniwalk

Description

@juniwalk
Issue body actions

Describe the bug

I am using toArray() method in onStart and in onSort to calculate difference in positions. However on my phone (in fallback mode) it was giving me larger array from onStart then onSort.

To me it looks like toArray() is including cloned element from fallback mode.

To Reproduce
Steps to reproduce the behavior:

  • Create sortable list with data-id attributes
  • Force fallback to be enabled
  • Log toArray on onStart and onSort
  • See that log from onStart has more elements

Expected behavior

I think cloned element should not have the [data-id] attribute so it would not be in the toArray

Information

Versions - Look in your package.json for this information:
sortablejs = ^1.15.6
@types/sortablejs = not used

Additional context
Add any other context about the problem here.

Reproduction
codesandbox: https://f2hf5l.csb.app/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.