Skip to content

Commit 4051aa5

Browse files
authored
fix(AnalyticalTable - useF2CellEdit): support interactive Icon (#7782)
1 parent c540e05 commit 4051aa5

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

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

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import type {
3232
TextAreaDomRef,
3333
TimePickerDomRef,
3434
ToggleButtonDomRef,
35+
IconDomRef,
3536
} from '../..';
3637
import {
3738
AnalyticalTable,
@@ -51,6 +52,7 @@ import {
5152
DynamicDateRange,
5253
FileUploader,
5354
IndicationColor,
55+
Icon,
5456
Input,
5557
MessageViewButton,
5658
MultiComboBox,
@@ -4103,19 +4105,29 @@ describe('AnalyticalTable', () => {
41034105
cy.realPress('ArrowDown');
41044106

41054107
cy.realPress('F2');
4106-
allRelevantInputCompontentsForF2.forEach((_) => {
4108+
allRelevantInputCompontentsForF2.forEach((col) => {
4109+
cy.log(col.Header);
4110+
if (col.id === 'segmented-button') {
4111+
// SegmentedButton has two tab stops
4112+
cy.realPress('Tab');
4113+
}
4114+
cy.realPress('F2');
4115+
cy.focused().should('have.attr', 'role', 'gridcell');
4116+
cy.realPress('F2');
41074117
cy.realPress('Tab');
41084118
});
4109-
// SegmentedButton has two tab stops
4110-
cy.realPress('Tab');
4119+
41114120
cy.focused().should('have.text', 'After');
41124121

4113-
cy.realPress('F2');
4114-
allRelevantInputCompontentsForF2.forEach((_) => {
4122+
cy.realPress(['Shift', 'Tab']);
4123+
allRelevantInputCompontentsForF2.forEach((col) => {
4124+
if (col.id === 'segmented-button') {
4125+
// SegmentedButton has two tab stops
4126+
cy.realPress(['Shift', 'Tab']);
4127+
}
41154128
cy.realPress(['Shift', 'Tab']);
41164129
});
41174130
// SegmentedButton has two tab stops
4118-
cy.realPress(['Shift', 'Tab']);
41194131
cy.focused().should('have.text', 'Before');
41204132
});
41214133

@@ -6016,6 +6028,14 @@ const allRelevantInputCompontentsForF2 = [
60166028
interactiveElementName: 'FileUploader',
60176029
tagName: 'ui5-file-uploader',
60186030
},
6031+
{
6032+
Header: 'Icon',
6033+
Cell: (props: AnalyticalTableCellInstance) => {
6034+
const callbackRef = useF2CellEdit.useCallbackRef<IconDomRef>(props);
6035+
return <Icon name="employee" mode="Interactive" ref={callbackRef} />;
6036+
},
6037+
interactiveElementName: 'Icon',
6038+
},
60196039
{
60206040
Header: 'Input',
60216041
id: 'input',

packages/main/src/components/AnalyticalTable/pluginHooks/useF2CellEdit.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const NON_STANDARD_INTERACTIVE_ELEMENTS = [
1414
'[ui5-segmented-button]',
1515
'[ui5-select]',
1616
'[ui5-slider]',
17+
'[ui5-split-button]',
18+
'[ui5-icon][mode="Interactive"]',
1719
];
1820

1921
/**

0 commit comments

Comments
 (0)