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

[SelectField] [DropDownMenu] Implement multiple select #1956

Closed
losogudok opened this issue Oct 21, 2015 · 19 comments
Closed

[SelectField] [DropDownMenu] Implement multiple select #1956

losogudok opened this issue Oct 21, 2015 · 19 comments
Labels
new feature New feature or request

Comments

@losogudok
Copy link

What do you think about multiple select?

@chrismcv
Copy link
Contributor

I think list (and therefore new menus) can do this. SelectField/DropDownMenu don't use the new menu's yet. Is that along the lines of what you were thinking...?

@oliviertassinari
Copy link
Member

@chrismcv I think so. I think that we need to updates SelectField and DropDownMenu to use the new Menu component.

@stevehu
Copy link
Contributor

stevehu commented Dec 31, 2015

+1. Also allow new entry to be added to support tagging..

@Tux1
Copy link

Tux1 commented Feb 14, 2016

I am trying to implement a kind of menu containing several checkboxes but it doesn't work well at the moment

Le 13 févr. 2016 à 20:29, Mathias Nilsson notifications@github.com a écrit :

Would love to see this feature.


Reply to this email directly or view it on GitHub.

@nathanmarks
Copy link
Member

@Va1 Please use the github +1 emojis instead of +1ing

@tintin1343 tintin1343 changed the title Implement multiple select [SelectField] [DropDownMenu] Implement multiple select Apr 20, 2016
@FranBran
Copy link

i would love to see a component like the one from MaterializeCSS:
multiSelect

support for tagging would also be nice to have!

@kkoch986
Copy link

i accomplished this using this code https://gist.github.com/kkoch986/34a43b79acd460cae527496a5fa6a982 havent tested it much yet but it seems to work ok. would be interested in what everyone else thinks about it.

@Sharlaan
Copy link

Sharlaan commented Aug 11, 2016

I think the multiselect feature discussion can be decoupled into 2 sub-features:

  1. the options menu :
    A great implementation would be the Angular-material "Select Header"
    At first glance, best component candidate from MaterialUI would be Autocomplete as it would only need a "multiple" prop which would
    • prevent the underlying popover to close onNewRequest()
    • transform the value prop into an array
    • make checkbox appears in MenuItem
    • Alternative to checkboxes: remove selected option from popover list (like with the React Toolbox component)
  2. display the selections
    This is kinda controversial, i found different views during my searches :
    1. angular-material's select simply concatenates string values directly in the input.
      This would be incompatible with typing suggestions in the Autocomplete's input. This would explain why they added another input into the menu.
      Then the selections would be either piling down like with angularMaterial component (fixed width), or a single string concatenating values with an ellipsis hiding overflowing text.
      I feel this option would not be the nicest as it modifes the overall UI height/width when expanding results
    2. Many e-commerce sites use autocompletes for filtering, i feel their implementation would be better and more flexible :
      Display of selections is externalized into a textarea below the AutoComplete components, the main input would simply have the placeholder text as default.
      The selections could then be displayed with chips like with VisualSearch.js
      A single selections container, coupled to multiple Autocomplete-multiselect components seems a nice idea.

What's your thoughts ?

@Sharlaan
Copy link

Sharlaan commented Oct 4, 2016

There are 2 proposed implementations you can use:

... but we are kinda waiting for Material-UI v0.16, major rewrites.

@abilashs90
Copy link

Any updates on this? This is like the most anticipated feature of MUI!

@Sharlaan
Copy link

Sharlaan commented Oct 18, 2016

True, i think also it might be the most WANTED component ! :Q___

Here is my current WIP.

I'm wondering if auto-completing the menu options is pertinent when there are only a few ...
How about including a props.maxItems above which the AutoCompleteTextField would appear ?

@prabhu
Copy link

prabhu commented Oct 27, 2016

@Sharlaan Your code is quite brilliant. Are you planning to create a component project with that?

@Sharlaan
Copy link

Here is my repo

@slavab89
Copy link
Contributor

slavab89 commented Nov 2, 2016

@Sharlaan Amazing!!
I'm going to try to integrate this into my project and see how it goes.

@jagribble
Copy link

@Sharlaan really useful!

@DDDDDanica
Copy link
Member

@Sharlaan How do you solve the issue of this line :
handleSelection = (name, value) => this.setState({ [name]: value })
It is also listed an example in Material-UI and gave me error of unexpected token =

@Sharlaan
Copy link

@ DDDDDanica :
Maybe you forgot to specify a name attribute on your component ?

Also (from memory) i remember getting this false error when using static keyword in class in unconfigured IDE...

Can you tell more about the context of your error ?

@kybarg kybarg mentioned this issue Mar 8, 2017
11 tasks
@oliviertassinari
Copy link
Member

@JessThrysoee did an awesome job extending the multiple property of the <Menu /> up to the <SelectField />. We now have three alternatives to address that multi-select problem:

  1. The material-ui-chip-input package that implements something close to what the Material Design specification is suggesting to do.
    demo
  2. The multiple property, we have an example in the documentation for the <SelectField />.
    mars-11-2017 15-39-57
  3. The material-ui-superselectfield package that kind of mix the two previous approaches.

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
Bumps [yup](https://github.com/jquense/yup) from 0.28.5 to 0.29.1.
- [Release notes](https://github.com/jquense/yup/releases)
- [Changelog](https://github.com/jquense/yup/blob/master/CHANGELOG.md)
- [Commits](jquense/yup@v0.28.5...v0.29.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@Frikster
Copy link

Frikster commented Jul 1, 2022

For anyone landing here note that the three solution libraries in the above comment appear to no longer be maintained. Best solution is likely to use MUI's autocomplete with multiple values.

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

No branches or pull requests