Skip to content

Commit

Permalink
More popover and filter dialog fixes (#5921)
Browse files Browse the repository at this point in the history
* add dialog role and aria-modal attributes for better screen reader support

* woopsies

* changesets

* sort and column popover as well

* update changeset

* Update packages-next/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/SortSelection.tsx

* copy change

* update copy

* more copy changes
  • Loading branch information
gwyneplaine committed Jun 18, 2021
1 parent de0a5c1 commit eab130f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-cows-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-ui/popover': patch
---

Applied aria-modal and role=dialog to popover component for better screen reader support.
5 changes: 5 additions & 0 deletions .changeset/tiny-walls-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': patch
---

Added more helpful aria-label and aria-description to filter, sort and column popover.
2 changes: 2 additions & 0 deletions design-system/packages/popover/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ export const PopoverDialog = forwardRef<HTMLDivElement, DialogProps>(
return (
<Portal>
<div
role="dialog"
aria-modal="true"
ref={consumerRef}
css={{
background: colors.background,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export function FieldSelection({

return (
<Popover
aria-label="Columns options"
aria-description={`list of column options to apply to the ${list.key} list`}
triggerRenderer={({ triggerProps }) => {
return (
<Button weight="link" css={{ padding: 4 }} {...triggerProps}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ export function FilterAdd({ listKey }: { listKey: string }) {
</Box>
<ChevronDownIcon size="small" />
</Button>
<PopoverDialog arrow={arrow} isVisible={isOpen} {...dialog.props} ref={dialog.ref}>
<PopoverDialog
aria-label="Filters options"
aria-description={`list of filters to apply to the ${listKey} list`}
arrow={arrow}
isVisible={isOpen}
{...dialog.props}
ref={dialog.ref}
>
{isOpen && (
<FilterAddPopoverContent
onClose={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ export function SortSelection({ list }: { list: ListMeta }) {
</span>
</Button>

<PopoverDialog arrow={arrow} isVisible={isOpen} {...dialog.props} ref={dialog.ref}>
<PopoverDialog
aria-label="Sort options"
aria-description={`list of sorting parameters to apply to the ${list.key} list`}
arrow={arrow}
isVisible={isOpen}
{...dialog.props}
ref={dialog.ref}
>
{isOpen && (
<SortSelectionPopoverContent
onClose={() => {
Expand Down

1 comment on commit eab130f

@vercel
Copy link

@vercel vercel bot commented on eab130f Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.