-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
scope: menuChanges related to the menu.Changes related to the menu.
Description
I need to generate a DropDownMenu dynamically, and some of the options (menu items) are grouped with a Divider and a Subheader. Kinda like
<DropDownMenu value={ current } onChange={ this.handleChange }>
{ groups.map(group => (
<div key={ group.name }>
<Divider />
<Subheader>{ group.name }</Subheader>
{ group.options.map(option => (
<MenuItem key={ option.key } value={ option.value } primaryText={ option.label } />
)) }
</div>
)) }
</DropDownMenu>Unfortunately, the handleChange handler only receives two arguments; the event object and an index. The value is always undefined, even if manually specified (i.e. therefore, it is not that option.value = "undefined";). I suspect it may have something to do with the <div> element in there; I'd have to actually read the code 😛
In any case, this is an issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
scope: menuChanges related to the menu.Changes related to the menu.