Skip to content

Conversation

daftspunk
Copy link
Contributor

@daftspunk daftspunk commented Apr 30, 2024

Steps to Reproduce Issue

  1. Create two sortables on the same page: List A and List B

  2. The options.handle must be specified for some reason

  3. Add an event when a checkbox is unchecked inside List A

  4. Set event to destroy and replace SortableJS on List B

Problem

All checkboxes on List A are rechecked when List B is rebound (via _nulling)

SortableJS-Bug

Expectation

The checkbox should remain unchecked

Proposed Fix

It seems to happen because savedInputChecked is a global instance. So List B's store will contain List A's checkboxes...

The proposed code ensures the checkboxes remain within the scope of the relevant instance.

Related

This may be a solution to #1052's continuation since people are still suggesting it's broken.

It could be why you can't reproduce it, since two SortableJS instances are needed to produce the collision/outcome.

@FluffyDiscord
Copy link

@owen-m1 can this be please merged? running into the same issue, where my checkboxes are being re-checked

@daftspunk
Copy link
Contributor Author

@FluffyDiscord Can you confirm the fix works? That may help the maintainer's confidence to merge it. Since the issue is complex and reproduction takes some time. Multi-user confirmation goes a long way.

@owen-m1 owen-m1 merged commit 3696da4 into SortableJS:master May 29, 2025
@owen-m1
Copy link
Member

owen-m1 commented May 29, 2025

Sorry for the delay

@robinbonnes
Copy link

@owen-m1 Can you make a new release? This is a pretty annoying bug.

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

Successfully merging this pull request may close these issues.

4 participants