Skip to content

Commit 8be0e35

Browse files
authored
fix(AnalyticalTable): fix focus behavior when tabbing (#7063)
Fixes #7062
1 parent cf721e5 commit 8be0e35

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,17 +3013,22 @@ describe('AnalyticalTable', () => {
30133013
cy.focused().parent().should('have.attr', 'ui5-button');
30143014

30153015
cy.mount(
3016-
<AnalyticalTable
3017-
data={generateMoreData(50)}
3018-
columns={columns}
3019-
selectionMode={AnalyticalTableSelectionMode.Multiple}
3020-
/>
3016+
<>
3017+
<AnalyticalTable
3018+
data={generateMoreData(50)}
3019+
columns={columns}
3020+
selectionMode={AnalyticalTableSelectionMode.Multiple}
3021+
/>
3022+
<button>Interactive Element</button>
3023+
</>
30213024
);
30223025

30233026
cy.findByText('Name-0').should('be.visible');
30243027
cy.window().focus();
30253028
cy.realPress('Tab');
30263029
cy.focused().should('have.attr', 'data-row-index', '0').should('have.attr', 'data-column-index', '1');
3030+
cy.realPress('Tab');
3031+
cy.focused().should('have.text', 'Interactive Element');
30273032

30283033
cy.mount(
30293034
<AnalyticalTable

packages/main/src/components/AnalyticalTable/TableBody/VirtualTableBodyContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export const VirtualTableBodyContainer = (props: VirtualTableBodyContainerProps)
122122
width: `${totalColumnsWidth}px`
123123
}}
124124
data-component-name="AnalyticalTableBody"
125+
tabIndex={-1}
125126
>
126127
{isMounted && children}
127128
</div>

packages/main/src/components/AnalyticalTable/scrollbars/VerticalScrollbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export const VerticalScrollbar = forwardRef<HTMLDivElement, VerticalScrollbarPro
6868
onScroll={handleVerticalScrollBarScroll}
6969
className={clsx(classNames.scrollbar, nativeScrollbar && 'ui5-content-native-scrollbars')}
7070
data-component-name="AnalyticalTableVerticalScrollbar"
71+
tabIndex={-1}
7172
>
7273
<div
7374
ref={scrollElementRef}

0 commit comments

Comments
 (0)