Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) => {
Expand All @@ -65,5 +89,9 @@ export const ResultsPaneOnDashboard = ({
);
});

return <Tabs fullWidth={false}> {panes} </Tabs>;
return (
<Wrapper>
<Tabs fullWidth={false}>{panes}</Tabs>
</Wrapper>
);
};