From 96d32fbfa1c0dcda85db3d06edaff36267023cfa Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Tue, 3 Aug 2021 11:08:00 +0200 Subject: Add aria-labels to odlux tables Add aria-labels to all table action buttons Issue-ID: CCSDK-3396 Signed-off-by: Aijana Schumann Change-Id: I1c3922c1d195727265882d3e3362607ab558d603 --- .../odlux/framework/src/components/material-table/index.tsx | 4 ++-- .../framework/src/components/material-table/tableToolbar.tsx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sdnr/wt/odlux/framework/src/components/material-table') diff --git a/sdnr/wt/odlux/framework/src/components/material-table/index.tsx b/sdnr/wt/odlux/framework/src/components/material-table/index.tsx index c74fd1a38..9155f38ec 100644 --- a/sdnr/wt/odlux/framework/src/components/material-table/index.tsx +++ b/sdnr/wt/odlux/framework/src/components/material-table/index.tsx @@ -159,7 +159,7 @@ type MaterialTableComponentBaseProps = WithStyles & { enableSelection?: boolean; disableSorting?: boolean; disableFilter?: boolean; - customActionButtons?: { icon: React.ComponentType, tooltip?: string, onClick: () => void, disabled?: boolean }[]; + customActionButtons?: { icon: React.ComponentType, tooltip?: string, ariaLabel: string, onClick: () => void, disabled?: boolean }[]; onHandleClick?(event: React.MouseEvent, rowData: TData): void; createContextMenu?: (row: TData) => React.ReactElement, React.ComponentType>>[]; }; @@ -253,8 +253,8 @@ class MaterialTableComponent extends React.Component { const entryId = getId(entry); - const isSelected = this.isSelected(entryId); const contextMenu = (this.props.createContextMenu && this.state.contextMenuInfo.index === index && this.props.createContextMenu(entry)) || null; + const isSelected = this.isSelected(entryId) || this.state.contextMenuInfo.index === index; return ( { numSelected: number | null; title?: string; tableId?: string; - customActionButtons?: { icon: React.ComponentType, tooltip?: string, onClick: () => void, disabled?: boolean }[]; + customActionButtons?: { icon: React.ComponentType, tooltip?: string, ariaLabel: string, onClick: () => void, disabled?: boolean }[]; onToggleFilter: () => void; onExportToCsv: () => void; } @@ -91,7 +91,7 @@ class TableToolbarComponent extends React.Component 0 ? classes.highlight : ''} `} >
@@ -110,7 +110,7 @@ class TableToolbarComponent extends React.Component ( - action.onClick()}> + action.onClick()}> @@ -118,20 +118,20 @@ class TableToolbarComponent extends React.Component 0 ? ( - + ) : ( - { this.props.onToggleFilter && this.props.onToggleFilter() }}> + { this.props.onToggleFilter && this.props.onToggleFilter() }}> )} -- cgit 1.2.3-korg