Skip to content

Commit 758ba66

Browse files
authored
fix: The responsive behaviour of the MainTable wrapped inside a ScrollableTable is not equivalent to the default case (#1247)
1 parent eff5bde commit 758ba66

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/components/ScrollableTable/ScrollableTable.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
display: block;
4646
}
4747

48-
tbody tr {
49-
display: block;
48+
tbody {
49+
display: grid;
5050
}
5151

52-
tbody tr:first-child {
53-
margin-top: $spv--x-large;
52+
tbody tr {
53+
display: block;
5454
}
5555
}
5656
}

src/components/ScrollableTable/ScrollableTable.stories.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,10 @@ export const Responsive: Story = {
104104
</>
105105
),
106106
},
107+
// Percy settings to capture at multiple widths
108+
percy: {
109+
responsiveSnapshotCapture: true,
110+
widths: [768, 1280],
111+
},
107112
},
108113
};

src/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ export const getElementAbsoluteHeight = (element: HTMLElement) => {
5959
}
6060
const style = window.getComputedStyle(element);
6161
const margin = toFloat(style.marginTop) + toFloat(style.marginBottom);
62-
const padding = toFloat(style.paddingTop) + toFloat(style.paddingBottom);
63-
return element.offsetHeight + margin + padding + 1;
62+
return element.offsetHeight + margin + 1;
6463
};
6564

6665
export const getAbsoluteHeightBelowById = (belowId: string): number => {

0 commit comments

Comments
 (0)