Skip to content

Commit

Permalink
fix(material/core): option showing double selected indicator in high …
Browse files Browse the repository at this point in the history
…contrast mode

Fixes that `mat-option` was showing a checkmark and a dot for selected options in high contrast mode. The dot is still necessary if the single selection indicator isn't shown.
  • Loading branch information
crisbeto committed Sep 10, 2024
1 parent 9122335 commit ef14c28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/material/core/option/option.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ $_side-padding: 16px;
// In single selection mode, the selected option is indicated by changing its
// background color, but that doesn't work in high contrast mode. We add an
// alternate indication by rendering out a circle.
&.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after {
&.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after {
$size: 10px;
content: '';
position: absolute;
Expand All @@ -170,7 +170,7 @@ $_side-padding: 16px;
border-radius: $size;
}

[dir='rtl'] &.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after {
[dir='rtl'] &.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after {
right: auto;
left: $_side-padding;
}
Expand Down

0 comments on commit ef14c28

Please sign in to comment.