No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Is it possible to change the selectItem text formatting?

    Consider the following image:
    Click image for larger version

Name:	Screenshot 2021-11-18 at 09.25.22.png
Views:	251
Size:	47.8 KB
ID:	266871
    In a multiple-select SelectItem, the actual text of what is selected quickly becomes useless IMO. I would like it to instead say for example "X items selected", but i cannot see any way to do it.

    I tried the ValueFormatter, but that only changes each individual selected item text (the 'Item 0', 'item 1' etc.)
    i would like to control the entire contents. I tried setting the 'value' in a ChangeHandler too, but that interferrred with the selection.

    Is this possible?

    Hi Mathias, unfortunately, we do not currently have an API that allows you to control the overall format (in fact we focused our effort on making sure that formatters worked on each individual item in a multi-select, as that's usually desired).

    Also, while we do see the value of showing the number of items selected, we don't think it necessarily makes sense as a complete replacement of the list of items. Even if the overall list is too long to read, it would often be useful to know the first, second, third items - whatever fits.

    So a few options:

    1. you could show the number of items externally to the control, as a dynamically updated hint, adjacent BlurbItem, or in some other way such as a hover

    2. you could use the existing per-value formatting option to add the overall count of items to the formatting for the first item (perhaps only if there are 3+ items selected, or whatever is unlikely to fit). So it would read like: "3 selected: item 1, item 2, item 3, ...". Here again, consider that your end users may value knowing the first and second items selected over knowing the overall count - a very app-specific thing, of course.

    3. if neither of the above work, we could add a new API, via Feature Sponsorship, if you want to control the overall format instead of the format of individual items


      Hey there. It's not a big deal, i just think it looks bad and doesn't provide much value.

      I kind of disagree with the end user value - you can either see the first items selected on screen in the list itself, or you have so many values in the list that it also does not provide very much useful info to see the, perhaps, 2 first items selected. Agree that might depend on the application.

      Having a separate label or something is a good idea, the suggestion about separate formatting for the first item might also improve the situation. I will discuss it with my boring product people ;) It doesn't make the dropdown text look less crummy though.