-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New prop for DropDownMenu: displayMemberOnLabel #2285
Conversation
displayMemberOnLabel
I added to SelectField too, @oliviertassinari |
Thanks. |
Hey @oliviertassinari. i updated everything as you want. |
@@ -210,7 +213,7 @@ const DropDownMenu = React.createClass({ | |||
|
|||
let selectedItem = this.props.menuItems[selectedIndex]; | |||
if (selectedItem) { | |||
displayValue = selectedItem[displayMember]; | |||
displayValue = selectedItem[labelMember || displayMember]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displayValue = selectedItem[labelMember];
May be better
@Sly777 Thanks, it's almost ready to be merged 👍 |
@oliviertassinari i updated doc & select-field. If it's still not okay, i can restore to back ;) |
It's ok for me 😃. |
I added examples 👍 aaaaandd it's finished i guess 😄 |
@Sly777 Nice. I would normally ask to squash down the commit, but since it's your first contribution, let's skip it. |
New prop for DropDownMenu: displayMemberOnLabel
wouldn't be better if we set labelMember = displayMember if it wasn't passed instead of set it to 'text'? |
That's a regression indeed! Sorry.
Sounds good. |
Prop Name: displayMemberOnLabel
Default Value: null
Prop Type: String
To show different value on selected item (for example; when you want to show country names on list but country code on Label, you can use this)