Skip to content

Commit 373b4ff

Browse files
authored
fix(searchbar): clear button has focus indicator (#25828)
1 parent c270756 commit 373b4ff

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

core/src/components/input/input.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@
147147
appearance: none;
148148
}
149149

150+
/**
151+
* Normally, we would not want to use :focus
152+
* here because that would mean tapping the button
153+
* on mobile would focus it (and keep it focused).
154+
* However, the clear button always disappears after
155+
* being activated, so we never get to that state.
156+
*/
150157
.input-clear-icon:focus {
151158
opacity: 0.5;
152159
}

core/src/components/searchbar/searchbar.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@
145145
appearance: none;
146146
}
147147

148+
/**
149+
* Normally, we would not want to use :focus
150+
* here because that would mean tapping the button
151+
* on mobile would focus it (and keep it focused).
152+
* However, the clear button always disappears after
153+
* being activated, so we never get to that state.
154+
*/
155+
.searchbar-clear-button:focus {
156+
opacity: 0.5;
157+
}
158+
148159
:host(.searchbar-has-value.searchbar-should-show-clear) .searchbar-clear-button {
149160
display: block;
150161
}

0 commit comments

Comments
 (0)