Skip to content

Commit f2f4926

Browse files
committed
[cleanup] Remove unnecessary unconstrainedWidth var/check
- it literally isn't doing anything as a check 🤷
1 parent a773651 commit f2f4926

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

packages/eui/src/components/datagrid/body/data_grid_body_virtualized.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ export const EuiDataGridBodyVirtualized: FunctionComponent<EuiDataGridBodyProps>
277277
*/
278278
const { finalWidth, finalHeight } = useFinalGridDimensions({
279279
unconstrainedHeight,
280-
unconstrainedWidth: 0, // unable to determine this until the container's size is known
281280
wrapperDimensions,
282281
wrapperRef,
283282
isFullScreen,

packages/eui/src/components/datagrid/utils/grid_height_width.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ import { DataGridSortedContext } from './sorting';
2222

2323
export const useFinalGridDimensions = ({
2424
unconstrainedHeight,
25-
unconstrainedWidth,
2625
wrapperDimensions,
2726
wrapperRef,
2827
isFullScreen,
2928
rowCount,
3029
}: {
3130
unconstrainedHeight: number;
32-
unconstrainedWidth: number;
3331
wrapperDimensions: { width: number; height: number };
3432
wrapperRef: MutableRefObject<HTMLDivElement | null>;
3533
isFullScreen: boolean;
@@ -69,16 +67,13 @@ export const useFinalGridDimensions = ({
6967
useEffect(() => {
7068
if (!wrapperRef.current) return;
7169
const wrapperWidth = wrapperRef.current.getBoundingClientRect().width;
72-
73-
if (wrapperWidth !== unconstrainedWidth) {
74-
setWidth(wrapperWidth);
75-
}
76-
}, [wrapperDimensions.width, unconstrainedWidth, wrapperRef]);
70+
setWidth(wrapperWidth);
71+
}, [wrapperDimensions.width, wrapperRef]);
7772

7873
const finalHeight = isFullScreen
7974
? fullScreenHeight
8075
: height || unconstrainedHeight;
81-
const finalWidth = width || unconstrainedWidth;
76+
const finalWidth = width || 0;
8277

8378
return IS_JEST_ENVIRONMENT
8479
? {

0 commit comments

Comments
 (0)