-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[DescriptionList] Long content styling fix #2880
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
b7388fb to
450d9d5
Compare
|
🟢 This pull request modifies 2 files and might impact 1 other files. Details:All files potentially affected (total: 1)📄
|
loic-d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would double check with UX if it makes sense to have an ellipsis overflow for the text cc/ @chloerice
🎩 looks great. If we want to move in this direction, I would apply a similar fix for mobile.
2ffd60d to
4fad74f
Compare
4fad74f to
ad86c5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, Marc! Adding word-break: break-word to .DescriptionList is all that's needed here to prevent overflow and enable long words to wrap like regular sentences do. If you need the content to be truncated instead of wrapping, you can wrap with Truncate.
| Large screen | Small screen |
|---|---|
![]() |
![]() |
Click to view collapsed playground code
import React from 'react';
import {Page, DescriptionList} from '../src';
export function Playground() {
return (
<Page title="Playground">
<DescriptionList
items={[
{
term: 'Logistics',
description:
'The management of products or other resources as they travel between a point of origin and a destination.',
},
{
term:
'The management of products or other resources as they travel between a point of origin and a destination.',
description:
'The management of products or other resources as they travel between a point of origin and a destination.',
},
{
term: 'Sole proprietorship',
description:
'A business structure where a single individual both owns and runs the company.',
},
{
term: 'Discount code',
description:
'A series of numbers and/or letters that an online shopper may enter at checkout to get a discount or special offer.',
},
]}
/>
</Page>
);
}
Much more succinct 💯 |
6bc917f to
9e9cb62
Compare
chloerice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
03ff8c8 to
01aeed3
Compare
5f52b6d to
32e7e83
Compare


WHY are these changes introduced?
This PR fixes an overflow and wrapping styling issue on the DescriptionList component.
More specifically, that long strings passed to the keys (
termanddescription) of anItemin theitemsprops of the component will not conserve their specific styling widths.WHAT is this pull request doing?
We add a couple css styles to not have long content overflow. This lets the component maintain it's already enforced widths for long content passed in.
Copy-paste this code in
playground/Playground.tsx:How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
🎩 checklist
README.mdwith documentation changes