Skip to content

Commit 32f6a15

Browse files
authored
fix(AnalyticalTable): return consistent values across all envs inonRowExpandChange (#5212)
Fixes #5207
1 parent e071424 commit 32f6a15

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/main/src/components/AnalyticalTable/hooks/useToggleRowExpand.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const getToggleRowExpandedProps = (rowProps, { row, instance, userProps }) => {
99
e.stopPropagation();
1010
}
1111

12-
row.toggleRowExpanded();
1312
let column = null;
1413
if (!isTreeTable && (!renderRowSubComponent || (renderRowSubComponent && alwaysShowSubComponent))) {
1514
if (!manualGroupBy) {
@@ -25,15 +24,22 @@ const getToggleRowExpandedProps = (rowProps, { row, instance, userProps }) => {
2524
payload: true
2625
});
2726
}
28-
onRowExpandChange(enrichEventWithDetails(e, { row, column }));
27+
28+
onRowExpandChange(
29+
enrichEventWithDetails(e, {
30+
row,
31+
column
32+
})
33+
);
34+
row.toggleRowExpanded();
2935
};
3036
const onKeyDown = (e) => {
3137
if (e.code === 'F4') {
3238
e.preventDefault();
3339
onClick(e, false);
3440
} else if ((!e.shiftKey && e.code === 'Space') || e.key === 'Enter') {
3541
// the `onClick` event of the `Icon` component already fires the event on ENTER/SPACE press
36-
if (e.target.hasAttribute('ui5-icon')) {
42+
if (e.target.hasAttribute('ui5-icon') || e.target.hasAttribute('ui5-button')) {
3743
return;
3844
}
3945
e.preventDefault();

0 commit comments

Comments
 (0)