Skip to content

Commit

Permalink
fix(material/list): not working correctly when list item is used as a…
Browse files Browse the repository at this point in the history
… button

Based on our selector for `mat-list-item`, we allow it to be a `button`, however we don't do the necessary resets for it to be usable.
  • Loading branch information
crisbeto committed Mar 29, 2022
1 parent 23f3929 commit e77a946
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/material/list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ $item-inset-divider-offset: 72px;
}
}

// We need some extra resets when the list items are buttons.
button.mat-list-item, button.mat-list-option {
border: none;
background: none;
padding: 0;
width: 100%;
}

// This mixin adjusts the heights and padding based on whether the list is in dense mode.
@mixin subheader-spacing($top-padding, $base-height) {
height: $base-height;
Expand Down

0 comments on commit e77a946

Please sign in to comment.