-
Notifications
You must be signed in to change notification settings - Fork 195
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(menu)!: reimplement text truncating #2299
Conversation
df24e4e
to
1daa17f
Compare
🚀 Deployed on https://pr-2299--spectrum-css.netlify.app |
File metricsSummaryTotal size: 3.97 MB*
Detailsmenu
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
@@ -369,11 +369,11 @@ governing permissions and limitations under the License. | |||
display: grid; | |||
/* stylelint-disable declaration-block-no-redundant-longhand-properties */ | |||
grid-template-areas: | |||
". chevronAreaCollapsible . iconArea sectionHeadingArea . . . " | |||
". chevronAreaCollapsible . headingIconArea sectionHeadingArea . . . " |
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 previously had two iconAreas
which causes some issues with menu item icons and labels not being on the correct row with in the grid.
@@ -528,8 +540,6 @@ governing permissions and limitations under the License. | |||
|
|||
.spectrum-Menu-itemLabel { | |||
grid-area: labelArea; | |||
display: flex; | |||
align-items: flex-start; |
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.
Flex was causing text-overflow: ellipsis;
to not work, was able to refactor the itemLabel to not need to rely on flex. This is what appeared to of broken the truncating functionality.
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 is looking good! A couple notes:
- On line 1333 in
components/menu/metadata/menu.yml
we have one more html...
that can be removed. - The Storybook control doesn't do anything except for on the Truncate page, I'm wondering if we should either limit the control to only show on that Truncate page or maybe set one of the menu items on the other stories to be able to show truncating? Let me know what you think!
@mdt2 Could you say more about this? It is defiantly working for me, although some are more subtle, If you adjust the I do think it's helpful to have the toggle on all of them, about half of them were not working previously and I think having the ability to see it in all variants could prevent it from regressing again. |
Oh my mistake! I had only tested a few that weren't long enough for truncation. Thanks for pointing me toward the |
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.
Great work Jenn!
b160174
to
3027a29
Compare
8fbf51f
to
6fdaf71
Compare
Description
BREAKING CHANGE
"Previously the spectrum-Menu-itemLabel--wrapping class could be added to the spectrum-Menu-itemLabel element in a Menu Item to prevent it from wrapping and force it to use an ellipsis instead."
Fix:
spectrum-Menu-itemLabel
haddisplay: flex;
read more about flex causing issues with truncate
...
Docs:
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
...
spectrum-Menu-itemLabel--truncate
to each menu item or headingRegression testing
Validate:
Screenshots
To-do list