Sortable: Fix a bug of removing an item while iterating an array #727

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@zhizhangchen

No description provided.

@scottgonzalez
jQuery Foundation member

As mentioned in your other pull request, we need bug reports and reduced test cases before pull requests.

@zhizhangchen

Problem: in some cases, iterating this.items will cause out of range problem, for example:
http://jsfiddle.net/7zT9C/2/
If you try to drag the $('.sortable.sortableItem'), there will be an error message in console:
Uncaught TypeError: Cannot read property 'item' of undefined

Solution:
http://jsfiddle.net/MLghp/1/

Should I open a bug report in http://bugs.jqueryui.com ?

@scottgonzalez
jQuery Foundation member

Thanks for the test case. If you can file a bug on that bug tracker, I'll update your commit message to reference the ticket and land your patch.

@scottgonzalez
jQuery Foundation member

Thanks, landed in 77a4aaf. Sorry for the delay, we had to get 1.9.0 out first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment