Skip to content

Commit

Permalink
fix(searchbar): clear button has focus indicator (#25828)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored Aug 26, 2022
1 parent c270756 commit 373b4ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@
appearance: none;
}

/**
* Normally, we would not want to use :focus
* here because that would mean tapping the button
* on mobile would focus it (and keep it focused).
* However, the clear button always disappears after
* being activated, so we never get to that state.
*/
.input-clear-icon:focus {
opacity: 0.5;
}
Expand Down
11 changes: 11 additions & 0 deletions core/src/components/searchbar/searchbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@
appearance: none;
}

/**
* Normally, we would not want to use :focus
* here because that would mean tapping the button
* on mobile would focus it (and keep it focused).
* However, the clear button always disappears after
* being activated, so we never get to that state.
*/
.searchbar-clear-button:focus {
opacity: 0.5;
}

:host(.searchbar-has-value.searchbar-should-show-clear) .searchbar-clear-button {
display: block;
}
Expand Down

0 comments on commit 373b4ff

Please sign in to comment.