fix(ui): make sure button labels can overflow#92311
Merged
Merged
Conversation
the old button as using `display: inline-block`, where `overflow: hidden` and `text-overflow: ellipsis` work as expected, as long as the element has a constrained width or max-width. The new button uses `display: inline-flex`, and flex items do not shrink as expected unless The flex item has min-width: 0
TkDodo
commented
May 27, 2025
Comment on lines
106
to
111
| })<Pick<CommonButtonProps, 'size' | 'borderless'>>` | ||
| height: 100%; | ||
| min-width: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; |
Collaborator
Author
There was a problem hiding this comment.
@JonasBa do you know why we have this duplication between button and linkButton ?
Member
There was a problem hiding this comment.
LinkButton was split from Button to simplify the API surface, but it doesn't seem like we gain much from it imo
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #92311 +/- ##
==========================================
- Coverage 87.91% 85.39% -2.52%
==========================================
Files 10204 10199 -5
Lines 584456 584320 -136
Branches 22689 22670 -19
==========================================
- Hits 513827 498986 -14841
- Misses 70208 84913 +14705
Partials 421 421 |
natemoo-re
approved these changes
Jun 3, 2025
natemoo-re
left a comment
Member
There was a problem hiding this comment.
Seems like a strong signal that our Button implementation isn't composable enough? Seems fine as a quick fix, but I expect similar edge cases to keep popping up.
andrewshie-sentry
pushed a commit
that referenced
this pull request
Jun 4, 2025
the old button as using `display: inline-block`, where `overflow: hidden` and `text-overflow: ellipsis` work as expected, as long as the element has a constrained width or max-width. The new button uses `display: inline-flex`, and flex items do not shrink as expected unless The flex item has min-width: 0 | before | after | |--------|--------| |  |  |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the old button as using
display: inline-block, whereoverflow: hiddenandtext-overflow: ellipsiswork as expected, as long as the element has a constrained width or max-width.The new button uses
display: inline-flex, and flex items do not shrink as expected unless The flex item has min-width: 0