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
Fix link control link preview when it displays long URLs. #60890
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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, @afercia!
Thank you @Mamaduka 👋🏽 |
This PR had an unintended side-effect of causing poor word-breaking in the inspector (#61277): There's probably a larger question going on here, that would be good to answer. Basically: should the truncation truncate the text only, or also affect the wrapping of text? If the former, we should probably use Would it be possible to use |
Fantastic, thanks! |
For context: Yes, in some cases, some components do add a custom |
Fixes #60860
What?
The link control 'link preview' layout breaks when it displays long URLs. When this happens, the buttons in the link control are pushed to the right and aren't visible due to the hidden overflow. As such, the important UI controls aren't operable.
Why?
The layout breaks making some controls impossible to use.
How?
The
Truncate
is expected to truncate long text lines in the link preview. It does so by using the CSS property-webkit-line-clamp
. However:-webkit-line-clamp
property works when some text breaks in two or more lines and then it limites the displayed lines to the specified value.-webkit-line-clamp
property to have any effect.word-break: break-all
CSS property makes sure that any text including long URLs break into more lines so that-webkit-line-clamp
works as expected.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before:
After: