Skip to content

Commit

Permalink
Add aria-checked
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Nov 30, 2023
1 parent 9c40cbc commit 250baba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/edit-site/src/components/dataviews/filter-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export default function FilterSummary( { filter, view, onChangeView } ) {
<DropdownMenuItem
key={ element.value }
role="menuitemradio"
aria-checked={
activeElement?.value === element.value
}
prefix={
activeElement?.value === element.value && (
<Icon icon={ check } />
Expand Down Expand Up @@ -144,6 +147,9 @@ export default function FilterSummary( { filter, view, onChangeView } ) {
<DropdownMenuItem
key="in-filter"
role="menuitemradio"
aria-checked={
filterInView?.operator === OPERATOR_IN
}
prefix={
filterInView?.operator === OPERATOR_IN && (
<Icon icon={ check } />
Expand Down Expand Up @@ -171,6 +177,9 @@ export default function FilterSummary( { filter, view, onChangeView } ) {
<DropdownMenuItem
key="not-in-filter"
role="menuitemradio"
aria-checked={
filterInView?.operator === OPERATOR_NOT_IN
}
prefix={
filterInView?.operator === OPERATOR_NOT_IN && (
<Icon icon={ check } />
Expand Down
9 changes: 9 additions & 0 deletions packages/edit-site/src/components/dataviews/view-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function HeaderMenu( { dataView, header } ) {
<DropdownMenuItem
key={ element.value }
role="menuitemradio"
aria-checked={ isActive }
prefix={
isActive && (
<Icon icon={ check } />
Expand Down Expand Up @@ -237,6 +238,10 @@ function HeaderMenu( { dataView, header } ) {
<DropdownMenuItem
key="in-filter"
role="menuitemradio"
aria-checked={
filterInView?.operator ===
OPERATOR_IN
}
prefix={
filterInView?.operator ===
OPERATOR_IN && (
Expand All @@ -260,6 +265,10 @@ function HeaderMenu( { dataView, header } ) {
<DropdownMenuItem
key="not-in-filter"
role="menuitemradio"
aria-checked={
filterInView?.operator ===
OPERATOR_NOT_IN
}
prefix={
filterInView?.operator ===
OPERATOR_NOT_IN && (
Expand Down

0 comments on commit 250baba

Please sign in to comment.