Aidurber / react-picky

Yet another React multiselect. With checkbox support instead of tags.
MIT License
79 stars 35 forks source link

RenderList can have it's own isSelected function based on allSelected state #210

Closed abarisic86 closed 4 years ago

abarisic86 commented 4 years ago

5.2.0

Unable to find a way to modify the component

Trying to modify the component that it is default all selected but that in that case, options besides selectAll are unchecked, when clicking on one they become selected

What I want to achive is actually to reverse the behaviour of the list when "all" is selected. And when you click first option after "all" is selected. It would show just "all" as selected and when first item is clicked it would set that item as only selected in the dropdown.

If you would consider that feature, I would prepare a PR for that.

image

Aidurber commented 4 years ago

Hi @abarisic86,

That seems like an uncommon use-case so I don't think it should be included in Picky.

I'm not entirely sure how we'd do this in Picky, you might have better luck with Downshift or writing your own. If you write your own it's not too difficult, I'm in the process of a rewrite you can take a look here Picky Rewrite and maybe tweak it for your scenario

Picky was built around more common use-cases with a medium amount of flexibility.