amitava82 / angular-multiselect

[NOT MAINTAINED]Native AngularJS multiselect directive

Home Page:http://amitava82.github.io/angular-multiselect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behaviour of the uncheckAll method

VladZen opened this issue · comments

https://github.com/amitava82/angular-multiselect/blob/master/src/multiselect.js#L231
there is a line in the code, that i can't understand. what is the point to remove checked mark only for items, that has been found according to search text, if it was typed?

Looks like unchecking within search context, if user wants up remove all items matched search text

And also there is a method
https://github.com/amitava82/angular-multiselect/blob/master/src/multiselect.js#L235
that accepts true as an argument.

but why should we always call it with an argument if we have local variable as isMultiple at the top of the code?
https://github.com/amitava82/angular-multiselect/blob/master/src/multiselect.js#L41

does it make any sense?

so got next situation:
we have single select. when we use it and select items in dropdown this method is fired
https://github.com/amitava82/angular-multiselect/blob/master/src/multiselect.js#L165
we call setModelValue twice: with different opposite arguments. i mean from uncheckedAll and then from selectSingle.

You could, works either way. Anyway, it's a 5 years old codebase, I never worked on this after release, haven't worked on Angular since React came out. I'm sure there are things that could be fixed and there are silly things like this considering I was just learning JS back then.. Send PR if you are interested to make improvements.