mirror of
https://github.com/apache/superset.git
synced 2026-08-05 13:32:41 +00:00
chore(a11y): enable jsx-a11y/prefer-tag-over-role as error (#42078)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -98,16 +98,13 @@ export default memo(
|
||||
key={item}
|
||||
className={currentPage === item ? 'active' : undefined}
|
||||
>
|
||||
<a
|
||||
href={`#page-${item}`}
|
||||
role="button"
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
onPageChange(item);
|
||||
}}
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`${item + 1}`}
|
||||
onClick={() => onPageChange(item)}
|
||||
>
|
||||
{item + 1}
|
||||
</a>
|
||||
</button>
|
||||
</li>
|
||||
) : (
|
||||
<li key={item} className="dt-pagination-ellipsis">
|
||||
|
||||
@@ -363,12 +363,16 @@ function StickyWrap({
|
||||
}
|
||||
|
||||
return (
|
||||
// Virtualized/sticky table built from divs so the header/body can be
|
||||
// positioned independently; a real <table> would break that layout, so
|
||||
// role="table" is the correct ARIA pattern here, not the suggested tag.
|
||||
<div
|
||||
style={{
|
||||
width: maxWidth,
|
||||
height: sticky.realHeight || maxHeight,
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
// eslint-disable-next-line jsx-a11y/prefer-tag-over-role
|
||||
role="table"
|
||||
>
|
||||
{headerTable}
|
||||
|
||||
@@ -163,8 +163,11 @@ export default styled.div`
|
||||
margin: 0 ${theme.marginXXS}px;
|
||||
}
|
||||
|
||||
.dt-pagination .pagination > li > a,
|
||||
.dt-pagination .pagination > li > button,
|
||||
.dt-pagination .pagination > li > span {
|
||||
appearance: none;
|
||||
border: 1px solid transparent;
|
||||
font: inherit;
|
||||
background-color: ${theme.colorBgBase};
|
||||
color: ${theme.colorText};
|
||||
border-color: ${theme.colorBorderSecondary};
|
||||
@@ -172,10 +175,10 @@ export default styled.div`
|
||||
border-radius: ${theme.borderRadius}px;
|
||||
}
|
||||
|
||||
.dt-pagination .pagination > li.active > a,
|
||||
.dt-pagination .pagination > li.active > button,
|
||||
.dt-pagination .pagination > li.active > span,
|
||||
.dt-pagination .pagination > li.active > a:focus,
|
||||
.dt-pagination .pagination > li.active > a:hover,
|
||||
.dt-pagination .pagination > li.active > button:focus,
|
||||
.dt-pagination .pagination > li.active > button:hover,
|
||||
.dt-pagination .pagination > li.active > span:focus,
|
||||
.dt-pagination .pagination > li.active > span:hover {
|
||||
background-color: ${theme.colorPrimary};
|
||||
|
||||
Reference in New Issue
Block a user