Skip to content

fix(select, autocomplete): no indication of active option in high contrast mode #10229

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 1 commit into from
Mar 6, 2018
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
17 changes: 17 additions & 0 deletions src/lib/core/option/option.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
padding-right: $mat-menu-side-padding * 2;
}
}

@include cdk-high-contrast {
$high-contrast-border-width: 1px;

// Add a margin to offset the border that we're adding to active option, in order
// to avoid the options shifting as the user is moving through the list.
margin: 0 $high-contrast-border-width;

&.mat-active {
// We use a border here, rather than an outline, because the outline will be cut off
// by the `overflow: hidden` on the panel wrapping the options, whereas a border
// will push the element inwards. This could be done using `outline-offset: -1px`,
// however the property isn't supported on IE11.
border: solid $high-contrast-border-width currentColor;
margin: 0;
}
}
}

// Collapses unwanted whitespace created by newlines in code like the following:
Expand Down