-
Notifications
You must be signed in to change notification settings - Fork 77
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
Buttons with long text should cut them off #5660
Comments
We have had some conflicting requests for the right resolution to text overflows in components. We may need to provide an optional prop or find another solution per designer's recommendations. @SkyeSeitz @ashetland |
Thanks, @alisonailea. Let's connect on all the text overflow requests as a collection. @yannikmesserli do either of these examples below demonstrate the expected behavior you are describing? |
The truncated version feels like the best failure state in the case. @alisonailea, we should sync up on other components where this occurs. Hopefully a similar strategy will work kit-wide. 🤞 |
Hopefully, we can arrive at a single way of handling this to avoid props if possible. Some additional things to consider:
|
Agreed 🪁
It probably makes sense to have an optional prop ( |
cc fix from #5683 (comment) |
@ashetland @SkyeSeitz #5683 (comment) addressed this problem in a separate component and its wrapping vs what's proposed above. Should this adopt the same approach? If not, can you chime in on guidelines for dealing with long text? |
Thanks, Franco. The guideline here would be to truncate long text on fixed width components that should not grow in height, such as the Button discussed above. This is to avoid oversized buttons and/or misalignment as seen below: For components that are meant to grow in height, such as Accordion, the guideline would be to wrap text as seen #5683. |
Summary of discussion about the best way to display the full text: Preference is for truncated buttons to use html label to display the full text. This would leave calcite-tooltip available for additional context and configurations. |
This comment in a related issue has some details of the implementation #5903 (comment) The image attached here shows how the |
**Related Issue:** #5660 ## Summary Truncate long text on fixed-width components that should not grow in height. To avoid unnecessary noise, detect the `buttons` with text that has been truncated and apply `title attribute` conditionally only to these, to reveal the full text for sighted users. This frees up the `calcite-tooltip` to provide additional context. Added an e2e test to ensure the long text is truncated and the `title attribute` is added when it is.
Installed and assigned for verification. |
Actual Behavior
When an unbreakable text is set to a button which is longer that what the button's width is capable of handling, the text overflow and break the button's layout.
Expected Behavior
The text should be cut-off.
Reproduction Sample
https://codepen.io/yannikm/pen/xxzGPRE?editors=100
Reproduction Steps
Check the codepen's sample above.
Reproduction Version
beta.97
Relevant Info
No response
Regression?
No response
Esri team
ArcGIS Scene Viewer
The text was updated successfully, but these errors were encountered: