Skip to content
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

Dropdown.Item ignores 'value' property #1191

Closed
Raptoer opened this issue Jan 20, 2017 · 2 comments
Closed

Dropdown.Item ignores 'value' property #1191

Raptoer opened this issue Jan 20, 2017 · 2 comments

Comments

@Raptoer
Copy link

Raptoer commented Jan 20, 2017

Dropdowns make a hidden select element as well as a tree of divs which are visible.
Inside the select there are options which contain both the text and the value properties.
Inside the tree of divs there are a number of div.item which contain the text, but not the value.

When the onChange handler is called the HTMLElement inside the event points to the div.item. Therefore the value property is difficult to access from the change handler.

This can actually be seen in the default codepen:
http://codepen.io/levithomason/pen/ZpBaJX
Although you have to go through the dom to find it.

@levithomason
Copy link
Member

Use the second data object parameter which includes all the props of the item, including value. One example is here: http://react.semantic-ui.com/modules/dropdown#allow-additions.

Once we get callback signatures listed in the docs, this will also be made more clear as the prop table will show precisely which arguments and values the callbacks are called with. This is coming soon!

@levithomason
Copy link
Member

I've just shipped the function signatures update to the docs. You can now see callback arguments along with their types and descriptions:

image

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

No branches or pull requests

2 participants