TablePanel: Make column headers keyboard-friendly (#44267)

pull/44281/head
kay delaney 4 years ago committed by GitHub
parent ebbb283d75
commit cc6839a21d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/grafana-ui/src/components/Table/HeaderRow.tsx
  2. 3
      packages/grafana-ui/src/components/Table/styles.ts

@ -55,11 +55,7 @@ function renderHeaderCell(column: any, tableStyles: TableStyles, field?: Field,
<div className={tableStyles.headerCell} {...headerProps} role="columnheader">
{column.canSort && (
<>
<div
{...column.getSortByToggleProps()}
className={tableStyles.headerCellLabel}
title={column.render('Header')}
>
<button {...column.getSortByToggleProps()} className={tableStyles.headerCellLabel}>
{showTypeIcons && (
<Icon name={getFieldTypeIcon(field)} title={field?.type} size="sm" className={tableStyles.typeIcon} />
)}
@ -67,7 +63,7 @@ function renderHeaderCell(column: any, tableStyles: TableStyles, field?: Field,
<div>
{column.isSorted && (column.isSortedDesc ? <Icon name="arrow-down" /> : <Icon name="arrow-up" />)}
</div>
</div>
</button>
{column.canFilter && <Filter column={column} tableStyles={tableStyles} field={field} />}
</>
)}

@ -92,6 +92,9 @@ export const getTableStyles = (theme: GrafanaTheme2) => {
}
`,
headerCellLabel: css`
border: none;
padding: 0;
background: inherit;
cursor: pointer;
white-space: nowrap;
overflow: hidden;

Loading…
Cancel
Save