Skip to content

Commit f27748f

Browse files
Merge pull request #1065 from equinor/fix/export-component-full-render
Fix/export-component-full-render
2 parents 70f27df + 713766d commit f27748f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@equinor/amplify-component-lib",
3-
"version": "9.8.3",
3+
"version": "9.8.4",
44
"description": "Frontend Typescript components for the Amplify team",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/atoms/utils/export.ts

+10
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ export const exportComponent = (
3636
}
3737

3838
const element = node.current;
39+
40+
const scrollWidth = element.scrollWidth;
41+
const scrollHeight = element.scrollHeight;
42+
43+
element.setAttribute('style', 'box-shadow: none');
44+
element.setAttribute('style', 'overflow: visible');
45+
3946
return html2canvas(element, {
4047
scrollY: -window.scrollY,
4148
useCORS: true,
4249
backgroundColor: backgroundColor ? backgroundColor : '#FFFFFF',
50+
width: scrollWidth,
51+
height: scrollHeight,
4352
}).then((canvas) => {
53+
element.removeAttribute('style');
4454
return dataURItoBlob(canvas.toDataURL('image/png', 1.0));
4555
});
4656
};

0 commit comments

Comments
 (0)