Skip to content

Commit

Permalink
chore: revert gridStyles update fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgadewoll committed Jun 4, 2024
1 parent de2cfd5 commit 9f0996d
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,6 @@ export class EuiDataGridCell extends Component<
this.recalculateLineHeight();
}

if (this.props?.shouldUpdateLineHeight === true) {
this.recalculateLineHeight();
}

if (
(this.props.rowHeightUtils as RowHeightVirtualizationUtils)
?.compensateForLayoutShift &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const CellWrapper: FunctionComponent<CellProps> = memo(
rowHeightsOptions,
rowHeightUtils,
rowManager,
shouldUpdateLineHeight,
...rest
}) => {
const popoverContext = useContext(DataGridCellPopoverContext);
Expand Down Expand Up @@ -156,7 +155,6 @@ export const CellWrapper: FunctionComponent<CellProps> = memo(
width={leadingColumn.width}
renderCellValue={rowCellRender}
isExpandable={false}
shouldUpdateLineHeight={shouldUpdateLineHeight}
{...rest}
/>
);
Expand All @@ -173,7 +171,6 @@ export const CellWrapper: FunctionComponent<CellProps> = memo(
width={trailingColumn.width}
renderCellValue={rowCellRender}
isExpandable={false}
shouldUpdateLineHeight={shouldUpdateLineHeight}
{...rest}
/>
);
Expand All @@ -197,7 +194,6 @@ export const CellWrapper: FunctionComponent<CellProps> = memo(
renderCellPopover={renderCellPopover}
interactiveCellId={interactiveCellId}
isExpandable={isExpandable}
shouldUpdateLineHeight={shouldUpdateLineHeight}
{...rest}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ import {
} from '../utils/grid_height_width';
import { useDefaultColumnWidth, useColumnWidths } from '../utils/col_widths';
import { useRowHeightUtils, useDefaultRowHeight } from '../utils/row_heights';
import { useShouldUpdateCellLineHeight } from '../utils/cell_heights';
import { useScrollBars, useScroll } from '../utils/scrolling';
import { IS_JEST_ENVIRONMENT } from '../../../utils';

export const Cell: FunctionComponent<GridChildComponentProps> = memo(
({ columnIndex, rowIndex, style, data }) => {
const { gridStyles, ...cellData } = data;
const memoizedStyles = useDeepEqual(style);
const cellStyles = useMemo(() => {
const { headerRowHeight } = data;
Expand All @@ -58,15 +56,12 @@ export const Cell: FunctionComponent<GridChildComponentProps> = memo(
};
}, [memoizedStyles, data]);

const shouldUpdateLineHeight = useShouldUpdateCellLineHeight(gridStyles);

return (
<CellWrapper
colIndex={columnIndex}
visibleRowIndex={rowIndex}
style={cellStyles}
shouldUpdateLineHeight={shouldUpdateLineHeight}
{...cellData}
{...data}
/>
);
}
Expand Down Expand Up @@ -339,7 +334,6 @@ export const EuiDataGridBodyVirtualized: FunctionComponent<EuiDataGridBodyProps>
rowManager,
pagination,
headerRowHeight,
gridStyles,
};
}, [
schemaDetectors,
Expand All @@ -360,7 +354,6 @@ export const EuiDataGridBodyVirtualized: FunctionComponent<EuiDataGridBodyProps>
rowManager,
pagination,
headerRowHeight,
gridStyles,
]);

const rowWrapperContextValue = useMemo(() => {
Expand Down
1 change: 0 additions & 1 deletion packages/eui/src/components/datagrid/data_grid_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ export interface EuiDataGridCellProps {
rowHeightUtils?: RowHeightUtilsType;
rowManager?: EuiDataGridRowManager;
pagination?: Required<EuiDataGridPaginationProps>;
shouldUpdateLineHeight?: boolean;
}

export interface EuiDataGridCellState {
Expand Down
38 changes: 0 additions & 38 deletions packages/eui/src/components/datagrid/utils/cell_heights.ts

This file was deleted.

0 comments on commit 9f0996d

Please sign in to comment.