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

[Drop-down-menu] Added multiple items selection support #844

Closed
wants to merge 3 commits into from
Closed

[Drop-down-menu] Added multiple items selection support #844

wants to merge 3 commits into from

Conversation

xmityaz
Copy link
Contributor

@xmityaz xmityaz commented Jun 14, 2015

User can set bool property "isMultiple" to make drop-down multiselectable.

Some screens attached bellow

  1. Multiselectable menu:
    2015-06-14 18 57 22
  2. Closed drop-down with several selected items
    2015-06-14 18 57 31

xmityaz added 2 commits June 9, 2015 23:32
@@ -23,7 +23,8 @@ var DropDownMenu = React.createClass({
onChange: React.PropTypes.func,
menuItems: React.PropTypes.array.isRequired,
menuItemStyle: React.PropTypes.object,
selectedIndex: React.PropTypes.number
selectedIndex: React.PropTypes.number,
isMultiple: React.PropTypes.array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool

@xmityaz
Copy link
Contributor Author

xmityaz commented Jun 14, 2015

@oliviertassinari thanks for your review. Mostly there are typos, fixed in next commit.

@oliviertassinari
Copy link
Member

@xmityaz If you can squash the 4 commits into one, it's event better

_handleMultipleSelect: function (key) {
var selectedItems = this.state.selectedItems,
item = this.props.menuItems[key],
index = selectedItems.indexOf(item);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be better to follow same approach as in the rest of code.
Thanks

@xmityaz
Copy link
Contributor Author

xmityaz commented Jun 15, 2015

@oliviertassinari unfortunately I can't squash first 2 commits. It were merge from original base. I think will be easier to fork repo again and push all changes in 1 commit, then just make new pull request.

@jkruder
Copy link
Contributor

jkruder commented Jun 20, 2015

As part of the data table #890 I added the capability to select multiple entries. The multi-select works almost identically to Excel's. We should look at abstracting this logic so that it can be shared between these components and others (the new list component comes to mind).

@hai-cea
Copy link
Member

hai-cea commented Jul 8, 2015

Thanks @xmityaz @oliviertassinari @jkruder multi item selection will be available on the new menus that will be released soon. It works much like how selects work, by passing an array of values into the value prop.

@hai-cea hai-cea closed this Jul 8, 2015
@zannager zannager added the component: menu This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants