fastselect icon indicating copy to clipboard operation
fastselect copied to clipboard

fastselect does not always deselect!

Open Fenno1974 opened this issue 8 years ago • 3 comments

With the multi-select option, the behavior I am expecting is when an item is deleted (by clicking on the cross), it is also deselected from the drop down. In some cases, this is occurring ok, but in other cases the item remains selected. (see attached).

This is the one that does not work: example that does not work

This one does work: example that does work

I have compared the html and cannot see any differences, so it is a mystery why the deselect is not working in some cases.

I am using MVC5 ASP.NET

Please help....

Fenno1974 avatar Mar 27 '17 04:03 Fenno1974

Problem solved! I did some debugging of the fastselect.js file to find that this problem only occurred when the value field of my options was an integer. If it was a Guid or string, it was perfectly ok.

By modifying line 608 of fastselect.js to be a == comparison, rather than === solved the problem! capture

Fenno1974 avatar Mar 28 '17 22:03 Fenno1974

Hi Fenno ! Thanks you so much ! I came here to solve the same problem, you saved me a lot of time.

xAlstrat avatar Jul 24 '17 03:07 xAlstrat

This code is now located on line 1171 in the current version. There is a similar comparison on line 938, presumably for adding the value rather than removing it, but it probably doesn't need to be changed.

DiMono avatar Oct 01 '18 18:10 DiMono