Skip to content

Commit a553005

Browse files
committed
Remove same height check from shouldComponentUpdate
- if we're not checking for sameHeight in componentDidUpdate, we also likely don't need this anymore, and all dynamic user changes appear to work without this code
1 parent 0eab3ab commit a553005

2 files changed

Lines changed: 0 additions & 26 deletions

File tree

src/components/datagrid/body/data_grid_cell.test.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,6 @@ describe('EuiDataGridCell', () => {
148148
component.setState({ disableCellTabIndex: true });
149149
});
150150
});
151-
152-
it('when cell height changes', () => {
153-
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', {
154-
configurable: true,
155-
value: 10,
156-
});
157-
const getRowHeight = jest.fn(() => 20);
158-
159-
component.setProps({ getRowHeight });
160-
});
161151
});
162152

163153
it('should not update for prop/state changes not specified above', () => {

src/components/datagrid/body/data_grid_cell.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -282,22 +282,6 @@ export class EuiDataGridCell extends Component<
282282
if (nextState.disableCellTabIndex !== this.state.disableCellTabIndex)
283283
return true;
284284

285-
// check if we should update cell because height was changed
286-
if (
287-
this.cellRef.current &&
288-
nextProps.getRowHeight &&
289-
nextProps.rowHeightUtils
290-
) {
291-
if (
292-
!nextProps.rowHeightUtils?.compareHeights(
293-
this.cellRef.current.offsetHeight,
294-
nextProps.getRowHeight(nextProps.rowIndex)
295-
)
296-
) {
297-
return true;
298-
}
299-
}
300-
301285
return false;
302286
}
303287

0 commit comments

Comments
 (0)