From 875e9f8a04464b0e79cfbda21d1e1ac7895970a5 Mon Sep 17 00:00:00 2001 From: Cody Leff Date: Tue, 6 Sep 2022 19:16:16 -0700 Subject: [PATCH] fix(dashboard): Fix scrolling on "View as table" modal (#21282) --- .../components/ResultsPaneOnDashboard.tsx | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx index 3f27929f5..ade2c1519 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx @@ -17,11 +17,34 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/core'; +import { t, styled } from '@superset-ui/core'; import Tabs from 'src/components/Tabs'; import { ResultTypes, ResultsPaneProps } from '../types'; import { useResultsPane } from './useResultsPane'; +const Wrapper = styled.div` + display: flex; + flex-direction: column; + height: 100%; + + .ant-tabs { + height: 100%; + } + + .ant-tabs-content { + height: 100%; + } + + .ant-tabs-tabpane { + display: flex; + flex-direction: column; + } + + .table-condensed { + overflow: auto; + } +`; + export const ResultsPaneOnDashboard = ({ isRequest, queryFormData, @@ -42,8 +65,9 @@ export const ResultsPaneOnDashboard = ({ dataSize, isVisible, }); + if (resultsPanes.length === 1) { - return resultsPanes[0]; + return {resultsPanes[0]}; } const panes = resultsPanes.map((pane, idx) => { @@ -65,5 +89,9 @@ export const ResultsPaneOnDashboard = ({ ); }); - return {panes} ; + return ( + + {panes} + + ); };