yanickrochon / jquery.uix.multiselect

Completely rewritten, multiselect widget with a more concise API
http://mind2soft.com/labs/jquery/multiselect/
MIT License
139 stars 62 forks source link

Demos - Simple Usage - Drag-and-Drop of the first Item in Non-Selected list #71

Closed komarad closed 10 years ago

komarad commented 11 years ago

Hello. I apologize ahead of time for not investigating this thoroughly. But this is what I encountered when installing the index.html demo: whenever I Drag-and-Drop the first element in the non-selected list it is being added in the selected list as disabled and it remains in the unselected list as well. Reloading the page and clicking on the same element adds it to the selected list without that issue. I checked - it happens for any element that is on top (I removed Afganistan option tag from the html code and same happened to Albania which was now on top of the unselected list and which I Drag-and-Dropped to the selected one). This was attempted on Mac OS 10.8.4 in Chrome 27.0.1453.116 and Safari 6.0.5 (8536.30.1)

Images: 1) at initial load 2) after Afganistan was Drag and Dropped 3) after Albania was Drag and Dropped (this is not reconstruction of what I stated earlier about Albania where it was on top of the initially loaded unselected list)

1

2

3

komarad commented 11 years ago

Observation: only happens if element is Drag-Dropped on top of another element or between elements. If it is added at the very end of the selected list above the area not occupied by other elements - addition goes smoothly.

yanickrochon commented 11 years ago

You are right. I can reproduce this with the demo page as well. However, it only happens if there are already selected items when the widget loads. As soon as I can, I will look into this.

kennethtruong commented 10 years ago

So if you look on line 817 if (_received_index) {

When the _received_index is 0 it doesn't go into the if statement when it should. This needs to be changed to

if (_received_index != undefined) {

and it should solve the problem. (:

yanickrochon commented 10 years ago

Good catch! If someone can confirm this and do a PR, I'll merge it.