Skip to content

Commit

Permalink
Remove redundant ARIA roles (#6562)
Browse files Browse the repository at this point in the history
* Remove redundant ARIA roles

The following elements already have intrinsic ARIA roles, so specifying them
again with role="..." is unnecessary.

- <table> has intrinsic role "table"
- <tr> has intrinsic role "row"
- <td> has intrinsic role "cell"
- <hr> has intrinsic role "separator"

* docs: add changelog

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
  • Loading branch information
iansjk and segunadebayo committed Sep 8, 2022
1 parent 9c6e883 commit 11afae6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/brown-hairs-behave.md
@@ -0,0 +1,6 @@
---
"@chakra-ui/menu": patch
"@chakra-ui/table": patch
---

Remove redundant ARIA roles
1 change: 0 additions & 1 deletion packages/components/menu/src/menu-divider.tsx
Expand Up @@ -10,7 +10,6 @@ export const MenuDivider: React.FC<MenuDividerProps> = (props) => {
const styles = useMenuStyles()
return (
<chakra.hr
role="separator"
aria-orientation="horizontal"
className={cx("chakra-menu__divider", className)}
{...rest}
Expand Down
1 change: 0 additions & 1 deletion packages/components/table/src/table.tsx
Expand Up @@ -33,7 +33,6 @@ export const Table = forwardRef<TableProps, "table">((props, ref) => {
return (
<TableStylesProvider value={styles}>
<chakra.table
role="table"
ref={ref}
__css={styles.table}
className={cx("chakra-table", className)}
Expand Down
1 change: 0 additions & 1 deletion packages/components/table/src/td.tsx
Expand Up @@ -13,7 +13,6 @@ export const Td = forwardRef<TableCellProps, "td">(

return (
<chakra.td
role="gridcell"
{...rest}
ref={ref}
__css={styles.td}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/table/src/tr.tsx
Expand Up @@ -5,5 +5,5 @@ export interface TableRowProps extends HTMLChakraProps<"tr"> {}
export const Tr = forwardRef<TableRowProps, "tr">((props, ref) => {
const styles = useTableStyles()

return <chakra.tr role="row" {...props} ref={ref} __css={styles.tr} />
return <chakra.tr {...props} ref={ref} __css={styles.tr} />
})

1 comment on commit 11afae6

@vercel
Copy link

@vercel vercel bot commented on 11afae6 Sep 8, 2022

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.