diff --git a/packages/kbn-unified-data-table/src/hooks/use_row_heights_options.ts b/packages/kbn-unified-data-table/src/hooks/use_row_heights_options.ts index 55eaa17c2c2ea..3df1a31aaa9d3 100644 --- a/packages/kbn-unified-data-table/src/hooks/use_row_heights_options.ts +++ b/packages/kbn-unified-data-table/src/hooks/use_row_heights_options.ts @@ -34,6 +34,8 @@ const serializeRowHeight = (rowHeight?: EuiDataGridRowHeightOption): number => { return ROWS_HEIGHT_OPTIONS.auto; } else if (typeof rowHeight === 'object' && rowHeight.lineCount) { return rowHeight.lineCount; // custom + } else if (typeof rowHeight === 'number') { + return rowHeight; } return ROWS_HEIGHT_OPTIONS.single; diff --git a/test/functional/apps/discover/group2/_data_grid_row_height.ts b/test/functional/apps/discover/group2/_data_grid_row_height.ts index 0cdfc16cb3536..109c35e25a24c 100644 --- a/test/functional/apps/discover/group2/_data_grid_row_height.ts +++ b/test/functional/apps/discover/group2/_data_grid_row_height.ts @@ -61,18 +61,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dataGrid.resetRowHeightValue(); - expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); + expect(await dataGrid.getCurrentRowHeightValue()).to.be('Custom'); - await dataGrid.changeRowHeightValue('Custom'); + await dataGrid.changeRowHeightValue('Auto fit'); await dataGrid.resetRowHeightValue(); - expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); + expect(await dataGrid.getCurrentRowHeightValue()).to.be('Custom'); }); it('should persist the selection after reloading the page', async () => { await dataGrid.clickGridSettings(); - expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); + expect(await dataGrid.getCurrentRowHeightValue()).to.be('Custom'); await dataGrid.changeRowHeightValue('Single');