Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Additional prop for x selected #29

Closed
Aidurber opened this issue Jan 3, 2018 · 3 comments
Closed

Additional prop for x selected #29

Aidurber opened this issue Jan 3, 2018 · 3 comments
Assignees

Comments

@Aidurber
Copy link
Owner

Aidurber commented Jan 3, 2018

An additional prop, not sure on the name, maybe manyDisplayedPlaceholder.

Not sure if a render prop or a sprintf style input like:

"You have selected %s" 

The render prop would be called with the number of selected items.

Leaning towards the latter.

@Aidurber Aidurber self-assigned this Jan 3, 2018
@Aidurber Aidurber mentioned this issue Jan 3, 2018
@AndreBastos23
Copy link

Yes that would suffice.
Do you think its possible to have maybe a prop that instead of saying "X selected" when all are selected, just says another string? For example "All" or something.

@Aidurber
Copy link
Owner Author

Aidurber commented Jan 3, 2018

Yes, since it will be a sprintf style input you could have whatever you want. The API will look like so:
manyDisplayedPlaceholder="Whatever"

If you want the number of items selected:
manyDisplayedPlaceholder="That's %s items selected"

It would be worth adding yet another prop allSelectedText which is shown when all items are selected.

No items selected: placeholder OR "None selected" (default)
Some items selected and <= numberDisplayed: "Item 1, Item 2"
Some items selected and > numberDisplayed: manyDisplayedPlaceholder OR "x selected" (default)
All selected: allSelectedText OR "x selected" (default)

@AndreBastos23
Copy link

Yeah that would be perfect :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants