[ChipGroup] Ability to set maximum visible row in Chipgroup
See original GitHub issueIs your feature request related to a problem? Please describe.
Yes, Currently ChipGroup can be populated with all dynamic chip
items as expected. But I want to show the items from the list which fits inside maximum of two (variable) lines only. But I can’t find any good solution for this issue I am facing currently.
Describe the solution you’d like
A very good solution will be returning the visible row count of the ChipGroup (optional) and limiting the maximum visible row count by using chipGroup.maxVisibleRowCount(2)
kind of method. And another enhancement will be filtering the chip items on the basis of best fit in per line/row inside the ChipGroup, which will show the perfect possible fit into the ChipGroup instead of showing asymmetric views and extra spaces end of the line/row.
Describe alternatives you’ve considered I used a fixed height to the ChipGroup and sometimes it breaks the UI on some small screen devices. To resolve this I reduced the list size which also doesn’t serve my purposes well yet. And for the enhancement, I am still working on it.
Additional context Current situation: https://i.stack.imgur.com/hxdJd.png My expectation on this: https://i.stack.imgur.com/Y406w.png
Here is my stackOverflow question link: https://stackoverflow.com/questions/59947859/how-can-i-limit-the-area-of-chip-items-the-wrap-area-to-2-lines-max-inside-the
We also happily accept pull requests.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top GitHub Comments
I want to put a ChipGroup in a HorizontalScrollView and show only 2 rows. Is there any way to achieve this?
This seems not a general use case but a very specific UX requirement. The suggestion in the linked stackoverflow question seems a good solution to me - or, you can even do it in a simpler way - just wrap the ChipGroup in a fixed height layout.
Since ChipGroup is not officially supported in our spec, there’s a low chance that we will implement this in the near future. However, if you feel strong about supporting this in general, we are glad to accept a pull request.
And about “put a ChipGroup in a HorizontalScrollView and show only 2 rows”, this sound like an even more specific use case to me. How about just creating two ChipGroups and implement the logic to decide which chips you want to put in which group?
Closing the issue for now…