-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Quick Navigation: truncate text #56142
Conversation
👍 👍 seems like a good solution. Happy to provide a green check but it seems it would be good to have a quick dev double-check too. |
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.
Code looks good to me ✅
Size Change: +20 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Thanks for the review, @jasmussen, @Mamaduka! |
This PR missed the required |
@oandregal Thank you, I didn't know that the |
What?
This PR solves the following two problems that occur when the button text of the
BlockQuickNavigation
component is long.For example, this is the list displayed in the sidebar content panel when
templateLock
mode iscontentOnly
. For heading blocks, this problem is easier to reproduce because the text is displayed instead of the block name.How?
Similar to the list view, I prevent text wrapping through the
Truncate
component. At the same time, I restructured the button contents withFlex
/FlexBlock
/FlexItem
so that the icon width is the same regardless of the text length.The only concern was that I needed some CSS to left-align the button text. This component doesn't have a stylesheet, so I added inline styles.
Testing Instructions
Paste the markup below into your code editor. This markup has a heading block with long text in a group that has
templateLock:contentOnly
set.