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

Add option to show how many items are selected instead of showing them all #151

Closed
FluffyDiscord opened this issue Feb 17, 2023 · 10 comments

Comments

@FluffyDiscord
Copy link

I am currently facing an issue where my select needs to be slim and can not expand vertically when selecting multiple things.

I suggest to allow showing how many items are selected if there is more than 1 item selected instead of showing them all. Selected items would also remain in the dropdown list and would be on top, so user can quickly de-select them.

How it looks:
image

How I imagine it would look like with this specific feature implemented:
image

@mskocik
Copy link
Owner

mskocik commented Feb 17, 2023

You mean something like this with collapseSelection property?

@FluffyDiscord
Copy link
Author

Kind of like that. The selected items should not be scrollable to the side, but show as mentioned, at the top of the dropdown list.

@mskocik
Copy link
Owner

mskocik commented Feb 17, 2023

Personally I don't think your suggestion is a good UX, when items jumps in the list up and down.

From technical perspective it's not possible with current implementation. Only thing, that could be updated is that collapseSelectionFn can return HTML string to be styled

Overflow was there just to demonstrate that ability to remove whatever items is still preserved.

@FluffyDiscord
Copy link
Author

The dropdown list is being updated anyway whenever user selects/deselects something so the items still jump in and out of existence.

Then what about making two lists - one with all selected options, second one bellow with the rest of the options just as shown? Both would be scrollable individually. That should be actually easier to implement, since there's no need to re-sort whole option list just to put selected ones on top.

@mskocik
Copy link
Owner

mskocik commented Feb 17, 2023

But is difference between hiding selected option from the list and jumping to the start of the list.

I am planning refactoring with additional slots for v4, so this would be possible then.

@FluffyDiscord
Copy link
Author

Any ETA on that please?

@mskocik
Copy link
Owner

mskocik commented Feb 17, 2023

Hopefully this year 🤞. I know that's not very helpful... But I don't have that much free time now.

@mskocik
Copy link
Owner

mskocik commented Feb 18, 2023

Check the updated REPL. That's basically your use case

@FluffyDiscord
Copy link
Author

Unfortunately not, since it expands the input vertically. I can not have that. I will try making a PR today

@FluffyDiscord
Copy link
Author

Adding link to PR #152

@mskocik mskocik closed this as completed in 8222963 Mar 5, 2023
mskocik added a commit that referenced this issue Apr 11, 2023
…in dropdown instead, inspired by #152

(cherry picked from commit 8222963)
mskocik added a commit that referenced this issue Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants