harvesthq/chosen — pull request #420 by dillonm-digisynd (2011-12-27 19:55:20+00:00)
Title: Workaround issue in FF where option.text is unpredictably empty

We were noticing an issue with Chosen where options were showing up correctly in Chrome, but not in Firefox.

In our use case, we have markup for our select options that look like this:

Label

When tracing through chosen.jquery in both Chrome and FF, I noticed that "option.text" was empty for this sort of markup on our site, but it had " Label" in Chrome. I tried to create a minimal test case to demonstrate this difference, but the following did not demonstrate any difference:

$('
Label
')[0].text

Regardless, adding a check for option.textContent in addition to option.text fixes the issue in FF and works as always in Chrome. If you need me to spend another hour trying to reproduce in a minimal test case, that may be doable.