sparkbox / Custom-Selectbox

Select box UI replacement
70 stars 25 forks source link

Option value with leading zero causes JS error #20

Closed bicknoyle closed 11 years ago

bicknoyle commented 11 years ago

If you have an option value with a leading zero (which correctly becomes a li attribute data-value with a leading zero), you're unable to select it.

The issue seems to lie with a jQuery.data() call that would return an integer-like string (ex: "05782") with the leading zero removed (presumably as an integer).

As a potential workaround, see the code below which uses jQuery.attr() to access the data-value attribute.

bicknoyle commented 11 years ago

Woof, I didn't notice my editor stripped all those spaces when I made the commit, sorry about that!

The only modification to look at is line 31. If you're going to use it I figure it'd be just as easy for you to make the change, but if you'd rather me submit a new pull request that only modifies that line, let me know.