-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Document Actions: Fix unexpected label wrapping #26004
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 Change: +84 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
david-szabo97
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.
Looks good to me! Chrome, Firefox and Safari ✅
|
I'm noticing the following visual issue on tablet views with long titles: What do you think about cutting off the text if it's too long and adding an ellipsis? Something along the lines of: .edit-site-document-actions__title {
/* ... */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 300px;
} |
| position: absolute; | ||
| color: $gray-900; | ||
| font-weight: bold; | ||
| white-space: nowrap; |
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 think we should add this to .edit-site-document-actions__title even when secondary label is not visible and make the styling consistent with this. If we allow wrapping in that case it will wrap very long titles, and then convert it to a one line after animating, which makes the animation a bit jarring imo.
Yeah it's definitely a problem. Noah mentioned it in the issue description "The text should not wrap at all. If the text is too long, it should probably be truncated. However, in this situation, the text isn't even "too long", it just wraps very early." I also brought it up earlier here. @vindl I was originally planning to address the just the text wrapping, and not the text overflow (overflow would potentially be a separate PR). Giving overflow more thought though, it might be simple to add some basic ellipses, so I'll experiment now and provide updates here. 👍 |
Nice, if it's simple enough, I'm totally fine with merging it along with this |
|
Quick update: @vindl @noahtallen Adding ellipses at an arbitrary max-width is easy enough (Marko's code works perfectly), but it looks strange when there's still a lot of white-space. I've been trying to allow text to truncate naturally when there is overflow (and there is no more negative space), but having everything play nicely with flexbox has been challenging. More can be read here. There are solutions proposed in the article, but apparently they don't work with flexbox items nested within other flexbox items, as is the case with our implementation. I'm planning to explore a bit more to try and figure out a css solution, but if that doesn't work out, I think a follow-up PR might be more appropriate. Note: |
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.
This might make things tricky, but I think the animation needs to be on the wrapper element so that it also animates the dropdown icon. Though it's not a huge issue right now, I do think it looks better to animate the dropdown, and we might end up showing the dropdown icon all the time anyways (at which point it would need to animate as well).
Other than that, the wrapping is working very well!
|
Update: I now have text overflow being handled by CSS. It looks like the animations worked all along. The dev build process was acting wonky 🙂 Edit: I originally left the wrong animation here. The corrected one should now be shown below |
44a3269 to
e4ae3dd
Compare
The icon should now be animated 🙂 |
noahtallen
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'm not a huge fan of hardcoding the flex-basis like this, but I'm not aware of a different solution. And I trust that you spent the time to find the right one that also works :)
This works great in all my testing, so I think we can go ahead and merge it!
0a28104 to
73ec44c
Compare



Description
When the title in the document actions area is too long, it wraps very easily. This causes visual issues and overlaps with the template part title.
How has this been tested?
Screenshots
Before
After
Types of changes
Bug fix for #25942
Checklist: