Skip to content

fix(AnalyticalTable): block interaction during loading #6602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading