Skip to content

Commit

Permalink
Make the “+ More” action for showing more filters/checkboxes keyboard…
Browse files Browse the repository at this point in the history
… accessible (#311)

* Convert '+ More' action to an accessible button tag

* Unset opinionated browser-level button styles

* Add custom hover/focus styling
- which overrides the default Chrome/browser-level focus ring, while still providing some UI indication/affordance to keyboard users tabbing through page
  • Loading branch information
Constance authored Jul 9, 2019
1 parent 0763094 commit 67ef8cd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/react-search-ui-views/src/MultiCheckboxFacet.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ function MultiCheckboxFacet({
</div>

{showMore && (
<div
<button
type="button"
className="sui-multi-checkbox-facet__view-more"
onClick={onMoreClick}
aria-label="Show more options"
>
+ More
</div>
</button>
)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ exports[`renders 1`] = `
</span>
</label>
</div>
<div
<button
aria-label="Show more options"
className="sui-multi-checkbox-facet__view-more"
onClick={[MockFunction]}
type="button"
>
+ More
</div>
</button>
</div>
`;

Expand Down Expand Up @@ -143,11 +145,13 @@ exports[`renders range filters 1`] = `
</span>
</label>
</div>
<div
<button
aria-label="Show more options"
className="sui-multi-checkbox-facet__view-more"
onClick={[MockFunction]}
type="button"
>
+ More
</div>
</button>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@
@include element("view-more") {
cursor: pointer;
color: $linkColor;

// Button reset
font-family: inherit;
font-size: inherit;
line-height: inherit;
text-align: left;
border: unset;
padding: unset;
background: unset;

&:hover,
&:focus {
background-color: $facetSelectBackground;
outline: $sizeXS solid $facetSelectBackground;
}
}
}

Expand Down

0 comments on commit 67ef8cd

Please sign in to comment.