Skip to content

Commit 6c3c997

Browse files
authored
[EuiTable] Fix mobile table row clip-path (#9206)
1 parent 4548eb7 commit 6c3c997

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed
24.7 KB
Loading
19.9 KB
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**Bug fixes**
2+
3+
- Fixed a visual bug in `EuiTable` where long table row content would be cut off on mobile screens
4+

packages/eui/src/components/basic_table/basic_table.stories.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import React, { useCallback, useEffect, useState } from 'react';
10+
import { css } from '@emotion/react';
1011
import type { Meta, StoryObj } from '@storybook/react';
1112
import { action } from '@storybook/addon-actions';
1213
import { faker } from '@faker-js/faker';
@@ -367,6 +368,32 @@ export const HighContrastMobile: Story = {
367368
},
368369
};
369370

371+
export const LargeExpandedRow: Story = {
372+
tags: ['vrt-only'],
373+
args: {
374+
tableCaption: 'EuiBasicTable playground',
375+
items: users,
376+
itemId: 'id',
377+
rowHeader: 'firstName',
378+
columns,
379+
css: css`
380+
margin-block-start: -300px;
381+
`,
382+
itemIdToExpandedRowMap: {
383+
1: (
384+
<div
385+
css={css`
386+
block-size: 100vh;
387+
`}
388+
>
389+
<strong>Expanded row 1</strong>
390+
<p>lorem ipsum dolor sit</p>
391+
</div>
392+
),
393+
},
394+
},
395+
};
396+
370397
const StatefulPlayground = ({
371398
items,
372399
pagination,

packages/eui/src/components/table/table_row.styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ export const euiTableRowStyles = (euiThemeContext: UseEuiTheme) => {
159159
${logicalCSS('border-top', 'none')}
160160
}
161161
162-
/* prevent the shadow from overlapping;
162+
/* prevent the shadow from overlapping; uses 150% to add buffer for overflowing content
163163
NOTE: we might want to consider refactoring tables to use tbody grouping to apply styles for a row group */
164-
clip-path: polygon(-50% 0, 150% 0, 150% 100vh, -50% 100vh);
164+
clip-path: polygon(-50% 0, 150% 0, 150% 150%, -50% 150%);
165165
166166
> .euiTableRowCell {
167167
${logicalCSS('width', '100%')}

0 commit comments

Comments
 (0)