fix(dashboard): Fix scrolling on "View as table" modal (#21282)

This commit is contained in:
Cody Leff 2022-09-06 19:16:16 -07:00 committed by GitHub
parent c382d53478
commit 875e9f8a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 3 deletions

View File

@ -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 <Wrapper>{resultsPanes[0]}</Wrapper>;
}
const panes = resultsPanes.map((pane, idx) => {
@ -65,5 +89,9 @@ export const ResultsPaneOnDashboard = ({
);
});
return <Tabs fullWidth={false}> {panes} </Tabs>;
return (
<Wrapper>
<Tabs fullWidth={false}>{panes}</Tabs>
</Wrapper>
);
};