Skip to content

fix(material-experimental/mdc-list): fix secondary line accidentally wrapping text #23236

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/material-experimental/mdc-list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,14 @@
.mat-mdc-list-item.mdc-list-item--with-trailing-meta > .mdc-list-item__end:empty {
display: none;
}

// Unset MDC's styles for wrapping secondary text in three-line lists. MDC implements three-line
// lists in a way where they assume that the second list line should wrap into the third line.
// This is different to the three-line list variant we want to support. We support a dedicated
// third line that can be controlled by consumers using a third `matLine` span.
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-list/_evolution-mixins.scss#L199.
// TODO: Consider removing once MDC supports the various three-line list variants.
.mat-mdc-list-item.mdc-list-item--with-three-lines .mdc-list-item__secondary-text {
white-space: nowrap;
line-height: normal;
}