Skip to content

Commit

Permalink
[a11y] More accessible MultiCheckboxFacets (#319)
Browse files Browse the repository at this point in the history
* ✨ Update MultiCheckboxFacet to use more screen reader accessible markup

* 🎨 Update styling to unset fieldset/legend styles

* ✅ Update test snapshots
  • Loading branch information
Constance committed Jul 9, 2019
1 parent eccaff7 commit 728f386
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/react-search-ui-views/src/MultiCheckboxFacet.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ function MultiCheckboxFacet({
searchPlaceholder
}) {
return (
<div
<fieldset
className={appendClassName(
"sui-multi-checkbox-facet sui-facet",
className
)}
>
<div className="sui-multi-checkbox-facet__label">{label}</div>
<legend className="sui-multi-checkbox-facet__label">{label}</legend>

{showSearch && (
<div className="sui-facet-search">
Expand Down Expand Up @@ -91,7 +91,7 @@ function MultiCheckboxFacet({
+ More
</button>
)}
</div>
</fieldset>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders 1`] = `
<div
<fieldset
className="sui-multi-checkbox-facet sui-facet"
>
<div
<legend
className="sui-multi-checkbox-facet__label"
>
A Facet
</div>
</legend>
<div
className="sui-multi-checkbox-facet__options-list"
>
Expand Down Expand Up @@ -75,18 +75,18 @@ exports[`renders 1`] = `
>
+ More
</button>
</div>
</fieldset>
`;

exports[`renders range filters 1`] = `
<div
<fieldset
className="sui-multi-checkbox-facet sui-facet"
>
<div
<legend
className="sui-multi-checkbox-facet__label"
>
A Facet
</div>
</legend>
<div
className="sui-multi-checkbox-facet__options-list"
>
Expand Down Expand Up @@ -153,5 +153,5 @@ exports[`renders range filters 1`] = `
>
+ More
</button>
</div>
</fieldset>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
font-size: 13px;
display: flex;
flex-direction: column;
// fieldset reset
margin: 0;
padding: 0;
border: 0;

@include element("label") {
font-size: $sizeM;
color: $facetLabel;
text-transform: uppercase;
letter-spacing: 1px;
// legend reset
padding: 0;
}

@include element("options-list") {
Expand Down

0 comments on commit 728f386

Please sign in to comment.