Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

select knob seems backwards #71

Closed
lifehackett opened this issue Nov 1, 2016 · 3 comments
Closed

select knob seems backwards #71

lifehackett opened this issue Nov 1, 2016 · 3 comments

Comments

@lifehackett
Copy link

Every time I use the select knob object syntax I write it incorrectly, but it also is more limiting. IMO it makes more sense that the dropdown would show the keys and on selection pass the value.

Additionally, the current setup restricts what can be passed as the prop value to strings or numbers because object keys are more restricted. i.e. you can't have a function or an object in the key position, but you could in the value.

I realize this would be a breaking change.

@webOS101
Copy link
Contributor

webOS101 commented Dec 7, 2016

Add to this that you cannot set null as a key, either. I went through some of our stories and found cases where people expected that they could use 'null': null inside the select. Needless to say, it doesn't work that way.

@bluetidepro
Copy link
Contributor

YES. Please fix this. It makes 0 sense why it was done this way. It is completely backwards.

@ndbroadbent
Copy link

ndbroadbent commented Feb 21, 2017

Oh yeah, I was just wondering why my numbers were all getting converted to strings. I was using this:

select('Size', { 4: 4, 6: 6, 9: 9 }, 4)

This definitely feels backwards. The main reason is because when you use this syntax, your keys must be strings, but the values can be any type.

EDIT: Actually, values are serialized in the URL so they will be strings anyway. I think I just need to use parseInt.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants