Skip to content

Commit 3e46a5a

Browse files
Merge pull request #13524 from rawagner/table_popover
OCPBUGS-27152: Fix popover jump in Tables
2 parents bec9899 + c274cde commit 3e46a5a

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

frontend/public/components/factory/Table/VirtualizedTableBody.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,20 @@ type VirtualizedTableBodyProps<D, R = {}> = {
2020
getRowClassName?: (obj: D) => string;
2121
};
2222

23-
const RowMemo = React.memo<RowProps<any, any> & { Row: React.ComponentType<RowProps<any, any>> }>(
24-
({ Row, ...props }) => <Row {...props} />,
23+
const RowMemo = React.memo<
24+
RowProps<any, any> & {
25+
Row: React.ComponentType<RowProps<any, any>>;
26+
isScrolling: boolean;
27+
style: React.CSSProperties;
28+
}
29+
>(
30+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
31+
({ Row, isScrolling, style, ...props }) => <Row {...props} />,
32+
(_, nextProps) => {
33+
if (nextProps.isScrolling) {
34+
return true;
35+
}
36+
},
2537
);
2638

2739
const VirtualizedTableBody = <D extends any, R extends any = {}>({
@@ -73,7 +85,7 @@ const VirtualizedTableBody = <D extends any, R extends any = {}>({
7385
title={getRowTitle?.(rowArgs.obj)}
7486
className={getRowClassName?.(rowArgs.obj)}
7587
>
76-
<RowMemo Row={Row} {...rowArgs} />
88+
<RowMemo Row={Row} {...rowArgs} style={style} isScrolling={isScrolling} />
7789
</TableRow>
7890
</CellMeasurer>
7991
);

0 commit comments

Comments
 (0)