Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 49447f7

Browse files
committed
Improved Algolia accessibility
1 parent 61ca444 commit 49447f7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

components/molecules/AlgoliaSearch/AlgoliaSearch.module.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
@apply relative;
1010

1111
& .trigger {
12-
@apply absolute left-0 top-0 w-full h-full z-10 cursor-text;
12+
@apply absolute left-0 top-0 w-full h-full z-10 cursor-text overflow-hidden;
13+
14+
text-indent: -9999px;
1315
}
1416
}
1517

@@ -20,6 +22,7 @@
2022
& input {
2123
@apply w-full p-10 pr-48 border border-tertiary-lighter rounded font-primary text-xs;
2224

25+
background: #fff;
2326
line-height: 1;
2427

2528
&::-webkit-search-decoration,

components/molecules/AlgoliaSearch/components/SearchPlaceholder.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SearchIcon from './SearchIcon'
1111
* @param {object} props The component attributes as props.
1212
* @param {Function} props.toggleAlgolia Toggle the Search component.
1313
* @param {string} props.query The search query.
14-
* @return {Element} The SearchPlaceholder component.
14+
* @return {Element} The SearchPlaceholder component.
1515
*/
1616
export default function SearchPlaceholder({toggleAlgolia, query}) {
1717
return (
@@ -29,15 +29,17 @@ export default function SearchPlaceholder({toggleAlgolia, query}) {
2929
toggleAlgolia(true)
3030
}
3131
}}
32-
/>
32+
>
33+
<span>Click to start searching</span>
34+
</div>
3335
<input
3436
tabIndex="-1"
3537
type="search"
3638
value={query}
3739
placeholder="Enter search term..."
3840
readOnly
3941
/>
40-
<button type="button" tabIndex="-1">
42+
<button type="button" tabIndex="-1" disabled>
4143
<SearchIcon />
4244
</button>
4345
</div>

0 commit comments

Comments
 (0)