harvesthq/chosen — pull request #1171 by pfiller (2013-04-26 20:18:10+00:00)
Title: Ensure choice count is reflective of actual selected item count.

Original pull request is #1070 by @tjarratt

This addresses some apparent issues where the ``@choices`` variable can get out of sync with the actual selected options length. It simply returns the number of selected elements on the underlying select box.

@kenearley @stof What do you think of this? I haven't been able to recreate the situation described by @tjarratt, but I don't really have a problem with this. Maintaining a variable with little performance gain seems unnecessary anyways.

I've done some click testing and it seems performant (especially so in modern browsers). In IE8 with 2k+ options, it's slow, but not noticeably slower than master.