Closed thibautRe closed 4 years ago
Hi @thibautRe, this is amazing! Great work.
I talked to @gmaclennan and @jencastrodoesstuff, who works directly with our partners. We decided that we do want to retire the old SelectOne behavior. That custom solution was implemented before the new material UI components.
It would be ideal to be able to turn off freeSolo
based upon the settings given on a per-project basis, which will be passed in through the presets. It should default to true.
Thanks so much! We can probably merge this soon, after a review from @gmaclennan
Thanks so much for this @thibautRe! We have a couple of big funding proposals that we need to finalise this week and I am re-locating back home after being stuck away from home during lockdown, so I might not get to review this until the end of next week, but looks like great work!
Thank you for the feedback! @gmaclennan no worries for the delayed review, I'll try to improve the typings of the SelectMultiple
component props, and retire the previous SelectOne
's downshift component in the meantime.
Thanks @thibautRe!
Fixes https://github.com/digidem/mapeo-desktop/issues/345
Overview
This adds a usable
<SelectMultiple />
component. It is a thin wrapper above@material-ui/lab/Autocomplete
that enablesfreeSolo
(user can write anything) andmultiple
(enables "tag" UI).I also added an example of what
SelectOne
could be if it were to useAutocomplete
. I noticed some specific logic related to how the options are being filtered in the current solution - I don't know if this is still relevant or not so I left the current component as is and exposed the new one under aSelectOnev2
name. It is available in the storybook if you want to test it for yourself.Component API changes
id
prop toSelectOne
andSelectMultiple
.