-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[AvatarGroup] Improve limit display #20793
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
Conversation
Details of bundle changes.Comparing: db011b3...b93c3f2 Details of page changes
|
|
@let-aurn This sounds smart, thanks for raising the idea. Atlaskit has the same tradeoff: https://codesandbox.io/s/lucid-lehmann-b8wik?file=/src/App.js:0-171. |
|
@let-aurn I have updated the demo to better illustrate the behavior. If you could add unit tests to ensure the logic is correct, it would be perfect. I believe the index change I did was required. |
|
@oliviertassinari, I can't make your version working const extraAvatars = children.length > max ? children.length - max + 1 : 0
// 👆IMO The children.length - 1 > max ? (...) : (...) |
|
So, PR updated. |
Display extra avatar if only one left (instead of showing the +1, let's just show the last avatar)