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

Fix dropdown with multiple selection #664

Open
LiliumCandidum opened this issue Oct 18, 2024 · 3 comments
Open

Fix dropdown with multiple selection #664

LiliumCandidum opened this issue Oct 18, 2024 · 3 comments
Labels
bug Something isn't working Dropdown component Label component and hooks related activities

Comments

@LiliumCandidum
Copy link
Contributor

Fix dropdown with multiple selection

The dropdown component with multiple selection needs some improvements:

  • it should appear a check icon when an item is selected
  • it shoudn't close when an item is selected/deselected
  • the color "on hover" of a selected item should be lighter

A snippet of code for replicating the issue or showing the proposal usage if applicable

See storybook multiple highlight selection

The expected result for your bug

See Dropdown documentation

@LiliumCandidum LiliumCandidum added bug Something isn't working Dropdown component Label component and hooks related activities labels Oct 18, 2024
@fredmaggiowski
Copy link
Member

it shoudn't close when an item is selected/deselected

regarding this I worry that it's the default behaviour controlled by antd, I'm not 100% confident it will be something feasible tbh

@LiliumCandidum
Copy link
Contributor Author

regarding this I worry that it's the default behaviour controlled by antd, I'm not 100% confident it will be something feasible tbh

I think that with open and onOpenChange props of the antd dropdown it's possible to control the open/close behaviour and implement it

@fredmaggiowski
Copy link
Member

fredmaggiowski commented Oct 18, 2024

I think that with open and onOpenChange props of the antd dropdown it's possible to control the open/close behaviour and implement it

Yes it is, but messing with the open prop will lead to lots of troubles: basically meaning that we would have to re-implement from scratch everything that antd already does for open state management.

As far as I've seen while working on the component, if you start controlling the open prop you will be given full control over it and will have to manage all the available triggers as well. (also onOpenChange will become practically useless, as you already know when the "open" state changed, since it is you who have changed it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Dropdown component Label component and hooks related activities
Projects
None yet
Development

No branches or pull requests

2 participants