isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

Selecting one option selects a different four items up (as well as that one) #488

Open sixteenstudio opened 7 years ago

sixteenstudio commented 7 years ago

I'm having a really strange issue with multiple selection where (only in certain option groups) if I press one option, it selects that but also a different one which is four options above that one.

Don't suppose this issue has been spotted before? I've trawled the issues and can't find anything similar.

My output-properties attribute is set to id, which is definitely unique. I can hopefully provide a reproduced version of this if no one is able to provide assistance without it.

Thanks!

isteven commented 7 years ago

@sixteenstudio ,

Would you be able to replicate this in Plunker / Fiddler so I can have a look?

sixteenstudio commented 7 years ago

@isteven

http://plnkr.co/edit/dmI4lih8N3R39mk0aly5?p=preview

Some instructions inside the plunk on how to cause the issue. This is a far stripped down version of what I have, and it still occurs, eliminating the chance of anything else causing the issue.

Thanks so much for your help dude! 👍

ferrisbuellers commented 7 years ago

@isteven I am having this exact issue!

The plunker @sixteenstudio has created shows the problem I am having.

This is causing issues for people on my site. Is this something you are looking into?

isteven commented 7 years ago

Thanks for the Plunker.

The directive creates it's own unique index (search indexProperty in the code) for looping. It's 5 digits random string. Since you have so many items, perhaps somehow these ID are duplicated, thus no longer unique.

I'm sorry that I haven't got chance to look further, but maybe, you can try to increase the number of digits in that unique index.

I never use that many option items with this.. probably that's why I never encountered that issue. Cheers.

ferrisbuellers commented 7 years ago

Thanks isteven, I have tried to up the index value, however it still does not work.

I looked and the index values are different but they still select more than one value.

WRinnovation commented 7 years ago

Hey guys! It was kinda tricky but I've resolved the issue on my fork!

iMomen commented 7 years ago

the problem is in this line $scope.inputModel[ inputModelIndex ][ $scope.tickProperty ] = $scope.filteredModel[ index ][ $scope.tickProperty ]