day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
797 stars 147 forks source link

Multi-select dropdown #150

Closed nikolap closed 3 years ago

nikolap commented 7 years ago

In addition to the single-dropdown component, it would be great to have a multi-dropdown component à la the multiple select dropdown from the Bootstrap + Chosen demo.

I've made a first pass attempt at this but need some feedback.

A critical decision made there is to unify single-dropdown and multi-dropdown into a generic dropdown function. There remains a deprecated single-dropdown function accessible in the re-com.dropdown namespace for existing projects, and is referred to in re-com.core.

I also attempted to maximize code reuse by integrating new features required for multi selection into existing dropdown-top, and choice-item.

The cost to doing this is that some args to dropdown become unusable in variations of dropdown. This includes:

Before I go any further down the rabbit hole (polishing, styling, etc.), feedback would be appreciated on whether unification into a generic dropdown function is a good approach or whether they should be kept as separate components. Also, of course, any thoughts or concerns on the changes made.

Gregg8 commented 7 years ago

Thanks! Have had a play with this and we'd considered doing a multi-version in the past but never got around to it.

What you have there in terms of naming is fine. dropdown makes sense and having single-dropdown there for backward compatibility is right.

Comments (I know you said you're not done so you no doubt know about these):

Gregg8 commented 7 years ago

Also, please note that the single-dropdown component code has changed for the soon-to-be-released re-com version so you'll likely need to address some conflicts :-(

nikolap commented 7 years ago

Appreciate the feedback! No worries about the conflicts, I can merge them in.

I'll work cleaning this up and be back with a PR shortly when it's up to snuff.

superstructor commented 3 years ago

See #224