-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Sorting a list with checked checkboxes causes intentionally unchecked boxes to revert to checked #1052
Comments
Just stumbled upon the same issue and can also validate it was working in v1.4.2. |
I have also noted the issue in v1.5.1 |
Still an issue with v1.5.1 But is working with v1.4.2 |
I'm also running into the same issue. |
I'm seeing this too, using sortablejs@1.6.0 and angular-sortablejs@2.0.6. It only happens if you specify a drag handle, fwiw. I just reverted to sortablejs@1.4.2 and the issue was resolved. |
To solve this bug, |
Problem for me as well |
This is a problem on anything that uses checkboxes. |
I'm experiencing this too. Took me some time to realise Sortable was the cause of the problem. Clicking on the handle (or any control within the handle) causes any toggled checkboxes to revert to their checked state. Any quick fix, without changing the source code, until this is fixed? |
@lbowers for quick fix just use version 1.4.2 unless you need some of the features available in latest (buggy version). It helped in my case. Maybe it isn't best solution but works. |
@RubaXa Can this code be removed from master since it causes this bug? |
To confirm it is related to Has anybody investigated if the proposed solution - removing |
Any update on this? It's causing a lot of problems in CyberChef. |
It looks like this has been fixed here: https://github.com/RubaXa/Sortable/blob/master/Sortable.js#L1503 However the package version has not been updated so this fix will not pull through to any projects building from npm. Could @RubaXa increment the patch version please? FYI, if you want a better fix that does not forget checked inputs on elements that are not currently being dragged, this might be a better solution: function _saveInputCheckedState(root) {
- savedInputChecked.length = 0;
-
var inputs = root.getElementsByTagName('input');
var idx = inputs.length;
while (idx--) {
var el = inputs[idx];
- el.checked && savedInputChecked.push(el);
+ var i = savedInputChecked.indexOf(el);
+ if (el.checked && i < 0) {
+ // el checked and not already in array
+ savedInputChecked.push(el);
+ } else if (el.checked === false && i >= 0) {
+ // el unchecked but in array
+ savedInputChecked.splice(i, 1);
+ }
}
} |
First off, thanks to the maintainers of this project! I've confirmed the current master branch fixes this for me. Any chance this will be released any time soon? |
It's been a whole year since this was reported and a fix still hasn't made its way into a release. Why? |
@RubaXa any chance this could be released anytime soon? Thanks. |
Just stumbled upon this issue and felt the need to warn you guys: this is a deal breaker. Had to switch from vue-draggable that depends on this package to MooTools Sortables. Yep. That MooTools that is depracated and old like dinosaurs. But it works. Tip: Do not use @RubaXa Would you please consider putting someone else in charge of this repo? |
Same problem as dominikfiala here, is there a chance for a fix to be released any soon? |
@dominikfiala @PierreGuyot This issue is fixed, see comment above: #1052 (comment) Someone just needs to take over maintaining this library and create a new release. |
Please check the latest version |
@owen-m1 the problem is still actual, at least for me. |
@tsyrya It works for me. Please reproduce in a JSBin. |
@owen-m1 I am sorry, seems like that was my fault (I didn't update the package correctly) and seems like it is working now. |
The problem stills occur to me in the latest version. If I specify a handle, the checkbox is not working at all when I click on the handle. What should I do? |
Yeah I'm seeing the same issue, still. It also breaks TinyMCE, too. |
I am modifying the checkboxes on the start event and on end the checkboxes are getting restored. Can we make this fix optional please? |
Still an issue with v1.13.0 |
@leftright1 its working for me, could you provide an example? |
The problem still persists when using .filter option |
Example: http://jsbin.com/belacoreki/edit?html,js,output
Reproduction steps:
What should happen: List is reordered with checkboxes maintaining their current state (ID unchecked)
What happens: List is reordered with the ID checkbox being re-checked.
Verified issue against master and 1.5.1 release. Regression from 1.4.2, verified does not have this issue (you can change the CDN link to https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.js to verify).
The text was updated successfully, but these errors were encountered: