Skip to content

Commit

Permalink
Fix: restore matching dropdown options focus/selected highlight (fixes
Browse files Browse the repository at this point in the history
…#526)

When navigating dropdown options via keyboard up/down arrows, there's no visual focus/highlight.

Issue introduced during previous PR (Fix 2): #507
  • Loading branch information
kirsty-hames authored Sep 9, 2024
1 parent d1e99b9 commit 05424bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions less/plugins/adapt-contrib-matching/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@
border-bottom: none;
}

.no-touch &:not(:focus-visible):hover,
.dropdown__btn.is-selected + .dropdown__list &[aria-selected="true"]:hover {
.no-touch &:not(:focus-visible):not([aria-selected="true"]):hover {
background-color: @item-color-hover;
color: @item-color-inverted-hover;
.transition(background-color @duration ease-in, color @duration ease-in;);
}

&:focus-visible,
.dropdown__btn.is-selected + .dropdown__list &[aria-selected="true"] {
&[aria-selected="true"] {
// This code can be used to style a non-native dropdown as closely
// as possible to the default browser settings
// background-color: Highlight;
Expand Down

0 comments on commit 05424bc

Please sign in to comment.