Skip to content

Commit

Permalink
fix(AnalyticalTable): block interaction during loading (#6602)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas742 authored Nov 14, 2024
1 parent d924cbf commit de3c96d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,14 @@ const meta = {
disableSortBy: true,
Cell: (instance) => {
const { cell, row, webComponentsReactProperties } = instance;
// disable buttons if overlay is active to prevent focus
const isOverlay = webComponentsReactProperties.showOverlay;
const { loading, showOverlay } = webComponentsReactProperties;
// disable buttons if overlay is active or the table is loading, to prevent focus
const disabled = loading || showOverlay;
// console.log('This is your row data', row.original);
return (
<FlexBox>
<Button icon="edit" disabled={isOverlay} />
<Button icon="delete" disabled={isOverlay} />
<Button icon="edit" disabled={disabled} />
<Button icon="delete" disabled={disabled} />
</FlexBox>
);
},
Expand Down
3 changes: 2 additions & 1 deletion packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
<span />
</BusyIndicator>
)}
{/*todo: use global CSS once --sapBlockLayer_Opacity is available*/}
{showOverlay && (
<>
<span id={invalidTableTextId} className={classNames.hiddenA11yText} aria-hidden>
Expand All @@ -727,7 +728,7 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
<div
aria-labelledby={titleBarId}
{...getTableProps()}
tabIndex={showOverlay ? -1 : 0}
tabIndex={loading || showOverlay ? -1 : 0}
role="grid"
aria-rowcount={rows.length}
aria-colcount={visibleColumns.length}
Expand Down

0 comments on commit de3c96d

Please sign in to comment.