Skip to content

Commit de3c96d

Browse files
authored
fix(AnalyticalTable): block interaction during loading (#6602)
1 parent d924cbf commit de3c96d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.stories.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,14 @@ const meta = {
9292
disableSortBy: true,
9393
Cell: (instance) => {
9494
const { cell, row, webComponentsReactProperties } = instance;
95-
// disable buttons if overlay is active to prevent focus
96-
const isOverlay = webComponentsReactProperties.showOverlay;
95+
const { loading, showOverlay } = webComponentsReactProperties;
96+
// disable buttons if overlay is active or the table is loading, to prevent focus
97+
const disabled = loading || showOverlay;
9798
// console.log('This is your row data', row.original);
9899
return (
99100
<FlexBox>
100-
<Button icon="edit" disabled={isOverlay} />
101-
<Button icon="delete" disabled={isOverlay} />
101+
<Button icon="edit" disabled={disabled} />
102+
<Button icon="delete" disabled={disabled} />
102103
</FlexBox>
103104
);
104105
},

packages/main/src/components/AnalyticalTable/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
710710
<span />
711711
</BusyIndicator>
712712
)}
713+
{/*todo: use global CSS once --sapBlockLayer_Opacity is available*/}
713714
{showOverlay && (
714715
<>
715716
<span id={invalidTableTextId} className={classNames.hiddenA11yText} aria-hidden>
@@ -727,7 +728,7 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
727728
<div
728729
aria-labelledby={titleBarId}
729730
{...getTableProps()}
730-
tabIndex={showOverlay ? -1 : 0}
731+
tabIndex={loading || showOverlay ? -1 : 0}
731732
role="grid"
732733
aria-rowcount={rows.length}
733734
aria-colcount={visibleColumns.length}

0 commit comments

Comments
 (0)