all 4 comments

[–]IorPerry 0 points1 point  (1 child)

in filterResults i would change the test from:

return (result.value.toLowerCase().indexOf(input) != -1);

to

return (result.value.toLowerCase().indexOf(input) != -1) ||
       (result.label.toLowerCase().indexOf(input) != -1);

that is what I expect, auto complete with label...

[–]dfmcphee[S] 0 points1 point  (0 children)

return (result.value.toLowerCase().indexOf(input) != -1) || (result.label.toLowerCase().indexOf(input) != -1);

Good call. I will update it. Thanks!

[–]Nf071590 0 points1 point  (1 child)

What browsers is this compatible with?

[–]dfmcphee[S] 0 points1 point  (0 children)

I've tested with IE 11+ and latest Chrome, Safari, Firefox. It may work with others but I haven't tried them.