Skip to content

Commit

Permalink
Fix datagrids inside height-limited containers becoming unscrollable …
Browse files Browse the repository at this point in the history
…on rowCount change
  • Loading branch information
cee-chen committed Nov 22, 2021
1 parent ceae152 commit cb9f462
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/components/datagrid/body/data_grid_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,6 @@ export const EuiDataGridBody: FunctionComponent<EuiDataGridBodyProps> = (
makeRowManager(innerGridRef)
);

// reset height constraint when rowCount changes
useEffect(() => {
setHeight(undefined);
}, [rowCount]);

useEffect(() => {
const boundingRect = wrapperRef.current!.getBoundingClientRect();

Expand All @@ -610,7 +605,7 @@ export const EuiDataGridBody: FunctionComponent<EuiDataGridBodyProps> = (
if (boundingRect.width !== unconstrainedWidth) {
setWidth(boundingRect.width);
}
}, [unconstrainedHeight, wrapperDimensions, isFullScreen]);
}, [rowCount, unconstrainedHeight, wrapperDimensions, isFullScreen]);

const preventTabbing = useCallback((records: MutationRecord[]) => {
// multiple mutation records can implicate the same cell
Expand Down

0 comments on commit cb9f462

Please sign in to comment.