Semantic-ui: Selection dropdown returns wrong value

Created on 16 Nov 2013  Â·  16Comments  Â·  Source: Semantic-Org/Semantic-UI

http://jsfiddle.net/vFPq2/4/

When some item's data value is setted to 0, the selection dropdown just returns the text in lower case.

Confirmed Bug

Most helpful comment

Unless you specify a value, from the <select> or as data-value="" it will use the lowercase text as the value

All 16 comments

355 and #277 related

Thanks, i will fix this today. Although 49ae497 was suppose to fix looks like some of the ternaries use default value syntax foo || bar in some places.which will treat 0 as undefined

There is still some problem here...
Again see the jsfiddle snippet above, when the "Male" item is selected, the text does not change...

@DanielBlack when a change is made it only means it'll be in the next release. You can download the repository and compile yourself, or wait until 0.9.4.

Alternatively, you can copy updated JavaScript modules into JSFiddle, which will override the packaged version. Here's an example.

@brigand thanks but this issue was already solved in 0.9.3.

@jlukic http://jsfiddle.net/vFPq2/4/ just try selecting the "Male" item.

@DanielBlack what browser are you testing on? It works for me on Chrome 30.

@brigand It does not work on both FF 25, Chrome 31 and Safari 7...

When I select the "Male" item, the text is still "Gender".

@DanielBlack ah, yes you're correct. I was looking at the text _under_ the dropdown.

I'm on basically 28.8 satellite uplink so i cant really work on anything fully, but i'm seeing the text change and the value appear correctly in Chrome 31. Are you positive this is not a caching issue on the semantic js?

I'm seeing it update to Female if you drop the dropdown.js file from master
into the fiddle; I can't get it to show Male (value 0).

And yes, I'm testing with the latest code and there's no caching problem;
at least with dropdown.js.

On Tue, Nov 19, 2013 at 8:40 PM, Jack Lukic [email protected]:

I'm on basically 28.8 satellite uplink so i cant really work on anything
fully, but i'm seeing the text change and the value appear correctly in
Chrome 31. Are you positive this is not a caching issue on the semantic js?

—
Reply to this email directly or view it on GitHubhttps://github.com/jlukic/Semantic-UI/issues/359#issuecomment-28863348
.

This was again a bug, an item could not be correctly selected if an item's value was "falsey". Fix shortly

i'm using Selection dropdown and returns all the text in lower case.
any help please ?

Unless you specify a value, from the <select> or as data-value="" it will use the lowercase text as the value

Thanks @jlukic , it's working perfectly.

can somebody add this to the documentation

@minafarid Just opened https://github.com/Semantic-Org/Semantic-UI-Docs/issues/145 to document this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Â·  3Comments

batata004 picture batata004  Â·  3Comments

guilhermeblanco picture guilhermeblanco  Â·  3Comments

kntmrkm picture kntmrkm  Â·  3Comments

mllamazares picture mllamazares  Â·  3Comments