Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(searchbox): add aria-hidden to svg icons #5547

Merged
merged 9 commits into from
Mar 16, 2023
1 change: 1 addition & 0 deletions examples/react-hooks/e-commerce/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ function SubmitIcon() {
width="16"
height="16"
viewBox="0 0 18 18"
aria-hidden="true"
>
<g
fill="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Array [
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Array [
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
1 change: 1 addition & 0 deletions examples/react/next/tests/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exports[`Next app recipes App renders without crashing 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exports[`react-router recipe App renders without crashing 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exports[`react-router recipe App renders without crashing 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Array [
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe('refinementList', () => {
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
>
<path
d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
Expand All @@ -112,6 +113,7 @@ describe('refinementList', () => {
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
>
<path
d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
Expand All @@ -128,6 +130,7 @@ describe('refinementList', () => {
stroke="#444"
viewBox="0 0 38 38"
width="16"
aria-hidden="true"
>
<g
fill="none"
Expand Down Expand Up @@ -277,6 +280,7 @@ describe('refinementList', () => {
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
>
<path
d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
Expand All @@ -293,6 +297,7 @@ describe('refinementList', () => {
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
>
<path
d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
Expand All @@ -309,6 +314,7 @@ describe('refinementList', () => {
stroke="#444"
viewBox="0 0 38 38"
width="16"
aria-hidden="true"
>
<g
fill="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('searchBox', () => {
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
Haroenv marked this conversation as resolved.
Show resolved Hide resolved
>
<path
d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
Expand All @@ -82,6 +83,7 @@ describe('searchBox', () => {
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
>
<path
d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
Expand All @@ -98,6 +100,7 @@ describe('searchBox', () => {
stroke="#444"
viewBox="0 0 38 38"
width="16"
aria-hidden="true"
>
<g
fill="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const defaultTemplate: SearchBoxComponentTemplates = {
viewBox="0 0 20 20"
width="10"
height="10"
aria-hidden="true"
>
<path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z" />
</svg>
Expand All @@ -23,6 +24,7 @@ const defaultTemplate: SearchBoxComponentTemplates = {
width="10"
height="10"
viewBox="0 0 40 40"
aria-hidden="true"
>
<path d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z" />
</svg>
Expand All @@ -36,6 +38,7 @@ const defaultTemplate: SearchBoxComponentTemplates = {
height="16"
viewBox="0 0 38 38"
stroke="#444"
aria-hidden="true"
>
<g fill="none" fillRule="evenodd">
<g transform="translate(1 1)" strokeWidth="2">
Expand Down
3 changes: 3 additions & 0 deletions packages/react-instantsearch-dom/src/components/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const defaultLoadingIndicator = (
xmlns="http://www.w3.org/2000/svg"
stroke="#444"
className={cx('loadingIcon')}
aria-hidden="true"
>
<g fill="none" fillRule="evenodd">
<g transform="translate(1 1)" strokeWidth="2">
Expand All @@ -40,6 +41,7 @@ const defaultReset = (
viewBox="0 0 20 20"
width="10"
height="10"
aria-hidden="true"
>
<path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z" />
</svg>
Expand All @@ -52,6 +54,7 @@ const defaultSubmit = (
width="10"
height="10"
viewBox="0 0 40 40"
aria-hidden="true"
>
<path d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z" />
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exports[`Menu Menu with search inside items but no search results 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -60,6 +61,7 @@ exports[`Menu Menu with search inside items but no search results 1`] = `
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down Expand Up @@ -182,6 +184,7 @@ exports[`Menu Menu with search inside items with search results 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -200,6 +203,7 @@ exports[`Menu Menu with search inside items with search results 1`] = `
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down Expand Up @@ -278,6 +282,7 @@ exports[`Menu applies translations 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -296,6 +301,7 @@ exports[`Menu applies translations 1`] = `
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exports[`RefinementList applies translations 1`] = `
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -60,6 +61,7 @@ exports[`RefinementList applies translations 1`] = `
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down Expand Up @@ -398,6 +400,7 @@ exports[`RefinementList refinement list with search inside items but no search r
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -416,6 +419,7 @@ exports[`RefinementList refinement list with search inside items but no search r
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down Expand Up @@ -550,6 +554,7 @@ exports[`RefinementList refinement list with search inside items with search res
height="10"
viewBox="0 0 40 40"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -568,6 +573,7 @@ exports[`RefinementList refinement list with search inside items with search res
height="10"
viewBox="0 0 20 20"
width="10"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down
Loading