Skip to content

Commit

Permalink
fix(@clayui/pagination): LPD-1285 accessibility issues on prev, next …
Browse files Browse the repository at this point in the history
…and ellipsis buttons
  • Loading branch information
pat270 committed Mar 6, 2024
1 parent 4aa86c2 commit 640dd96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/clay-core/src/drop-down/Menu.tsx
Expand Up @@ -214,7 +214,7 @@ function MenuInner<T extends Record<string, unknown> | string | number>(
return (
<div className="dropdown" ref={containerRef}>
{React.cloneElement(trigger, {
'aria-controls': ariaControlsId,
'aria-controls': active ? ariaControlsId : undefined,
'aria-expanded': active,
'aria-haspopup': 'true',
className: classNames(
Expand Down
10 changes: 10 additions & 0 deletions packages/clay-pagination/src/PaginationWithBasicItems.tsx
Expand Up @@ -164,6 +164,11 @@ const ClayPaginationWithBasicItems = React.forwardRef<HTMLUListElement, IProps>(
disabled={internalActive === 1}
href={previousHref}
onClick={() => setActive(previousPage)}
role={
previousHref || internalActive === 1
? undefined
: 'button'
}
>
<ClayIcon spritemap={spritemap} symbol="angle-left" />
</Pagination.Item>
Expand Down Expand Up @@ -217,6 +222,11 @@ const ClayPaginationWithBasicItems = React.forwardRef<HTMLUListElement, IProps>(
disabled={internalActive === totalPages}
href={nextHref}
onClick={() => setActive(nextPage)}
role={
nextHref || internalActive === totalPages
? undefined
: 'button'
}
>
<ClayIcon spritemap={spritemap} symbol="angle-right" />
</Pagination.Item>
Expand Down

0 comments on commit 640dd96

Please sign in to comment.