-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Option] fix word-break on option label #4411
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
size-limit report
|
| cursor: pointer; | ||
| border-radius: var(--p-border-radius-base); | ||
| padding: spacing(tight); | ||
| word-break: break-word; |
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.
👋 Just a heads up this property is deprecated
Better to use overflow-wrap: anywhere which should work in the same way
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.
🤔 anywhere isn't supported by Safari. In that case should we include both for backward compatibility ?
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#browser_compatibility
Unless we go with word-break: break-all;
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.
As discussed on slack, overflow-wrap: anywhere is not an option as it isn't supported by Safari. Instead, I went with word-break: break-all which achieves intended fix and also works with Chinese/Japanese/Korean (CJK) text.
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.
So after another find 💡 by Kyle, I've instead used the mixin text-breakword
954c16d to
ed300df
Compare
7f43275 to
5477faf
Compare
5477faf to
6882523
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.
Thank you @patrickracicot! 🚀
|
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
Fixes part of #22937
Prevents horizontal scrollbar for very long option text inside an OptionList.
WHAT is this pull request doing?
This PR ensures that the label in the Option of the OptionList breaks when it's too long for the space of the option list.
Before

After

How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx:🎩 checklist
README.mdwith documentation changes