From 79e3daf99919355139aa3151ae4984fa9c835a6f Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Tue, 28 Sep 2021 12:21:19 -0700 Subject: [PATCH] Add documentation snippet example NOTE: I did not update the actual example, since that uses EuiText which overrides line-height, and is no longer a good example to demo lineHeight with --- .../src/views/datagrid/datagrid_height_options_example.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src-docs/src/views/datagrid/datagrid_height_options_example.js b/src-docs/src/views/datagrid/datagrid_height_options_example.js index 4799ab28685f..871c7392f2a0 100644 --- a/src-docs/src/views/datagrid/datagrid_height_options_example.js +++ b/src-docs/src/views/datagrid/datagrid_height_options_example.js @@ -26,6 +26,9 @@ const rowHeightsSnippet = `rowHeightsOptions = { 4: 200, // for row which have index 4 we set 140 pixel 5: 80, }, + lineHeight: '1em', // default every cell line-height to 1em + // NOTE: if you wrap your cell content in CSS that overrides/sets line-height (e.g. in an EuiText), + // EuiDataGrid will not calculate row height correctly - make sure to match this to your used line height }`; const rowHeightsFullSnippet = `const rowHeightsOptions = useMemo( @@ -122,6 +125,10 @@ export const DataGridRowHeightOptionsExample = { rowHeights - overrides the height for a specific row +
  • + lineHeight - set a default line height for all + cells, which is also used to calculate row height +
  • Each of these can be configured with an exact pixel height, a line