Skip to content

Commit

Permalink
Autocompleter UI: Fix text color when hovering selected item (#64294)
Browse files Browse the repository at this point in the history
* Autocompleter UI: Fix text color when hovering selected item

* Update changelog

* Restore `is-selected` CSS class

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
  • Loading branch information
5 people authored Aug 7, 2024
1 parent 2b2e7fb commit ccd8dac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- `CustomSelectControl`: Restore `describedBy` functionality ([#63957](https://github.com/WordPress/gutenberg/pull/63957)).
- `Button`: Improve the aria-disabled focus style ([#62480](https://github.com/WordPress/gutenberg/pull/62480)).
- `Modal`: Fix the dismissal logic for React development mode ([#64132](https://github.com/WordPress/gutenberg/pull/64132)).
- `Autocompleter UI`: Fix text color when hovering selected item ([#64294](https://github.com/WordPress/gutenberg/pull/64294)).

### Enhancements

Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/autocomplete/autocompleter-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ function ListBox( {
'components-autocomplete__result',
className,
{
// Unused, for backwards compatibility.
'is-selected': index === selectedIndex,
}
) }
variant={ index === selectedIndex ? 'primary' : undefined }
onClick={ () => onSelect( option ) }
>
{ option.label }
Expand Down
6 changes: 0 additions & 6 deletions packages/components/src/autocomplete/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,4 @@
&:focus:not(:disabled) {
@include block-toolbar-button-style__focus();
}

&.is-selected,
&:not(:disabled,[aria-disabled="true"]):active {
background: $components-color-accent;
color: $white;
}
}

0 comments on commit ccd8dac

Please sign in to comment.