diff --git a/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.styled.tsx b/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.styled.tsx index 13cb1de23d6cfb54c41742ce5fdd4697137edff8..ff2e92a059989a64ab43c621788f68615007f8e0 100644 --- a/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.styled.tsx +++ b/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.styled.tsx @@ -13,6 +13,7 @@ import { export const Root = styled.div<{ hasScroll: boolean; + hasVisibleOverflowWhenPriting?: boolean; isBordered?: boolean; }>` display: flex; @@ -36,6 +37,16 @@ export const Root = styled.div<{ border-radius: 8px; box-shadow: 0 2px 2px var(--mb-color-shadow); `} + + ${props => + // Prevents https://github.com/metabase/metabase/issues/40660 + // when printing an embedded dashboard + props.hasVisibleOverflowWhenPriting && + css` + @media print { + overflow: visible; + } + `} `; export const ContentContainer = styled.div` diff --git a/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx b/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx index cdbc49be45ae74b14fa08a2ed9ccde7fc0776218..46d8c08737627991fb56751472572f2936b9aacf 100644 --- a/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx +++ b/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx @@ -12,6 +12,7 @@ import { } from "metabase/dashboard/components/Dashboard/Dashboard.styled"; import { ExportAsPdfButton } from "metabase/dashboard/components/DashboardHeader/buttons/ExportAsPdfButton"; import { DASHBOARD_PDF_EXPORT_ROOT_ID } from "metabase/dashboard/constants"; +import { getDashboardType } from "metabase/dashboard/utils"; import { initializeIframeResizer, isSmallScreen } from "metabase/lib/dom"; import { useSelector } from "metabase/lib/redux"; import { FilterApplyButton } from "metabase/parameters/components/FilterApplyButton"; @@ -105,6 +106,10 @@ export const EmbedFrame = ({ state => !getSetting(state, "hide-embed-branding?"), ); + const isPublicDashboard = Boolean( + dashboard && getDashboardType(dashboard.id) === "public", + ); + const ParametersListComponent = getParametersListComponent({ isEmbeddingSdk, isDashboard: !!dashboard, @@ -140,6 +145,7 @@ export const EmbedFrame = ({ <Root hasScroll={hasFrameScroll} isBordered={bordered} + hasVisibleOverflowWhenPriting={isPublicDashboard} className={cx(EmbedFrameS.EmbedFrame, className, { [EmbedFrameS.NoBackground]: !background, })}