[Lens] Fixes chart scroll when the legend is long (#143340)

* [Lens] Fixes chart scroll when the legend is long

* Remove unnecessary css prop

* Apply PR comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Stratoula Kalafateli 2022-10-18 10:47:11 +03:00 committed by GitHub
parent b7d3809b8c
commit b288c2fcb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 15 deletions

View file

@ -9,6 +9,12 @@
overflow: visible;
height: 100%;
.lnsWorkspacePanelWrapper__content {
width: 100%;
height: 100%;
position: absolute;
}
.lnsWorkspacePanelWrapper__pageContentBody {
@include euiBottomShadowMedium;
@include euiScrollBar;

View file

@ -8,13 +8,7 @@
import './workspace_panel_wrapper.scss';
import React, { useCallback } from 'react';
import {
EuiPageSection,
EuiPageTemplate,
EuiFlexGroup,
EuiFlexItem,
EuiButton,
} from '@elastic/eui';
import { EuiPageTemplate, EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui';
import classNames from 'classnames';
import { FormattedMessage } from '@kbn/i18n-react';
import { DatasourceMap, FramePublicAPI, VisualizationMap } from '../../../types';
@ -118,9 +112,9 @@ export function WorkspacePanelWrapper({
warningMessages.push(...requestWarnings);
}
return (
<EuiPageTemplate direction="row" grow={true} offset={0} minHeight={0} responsive={[]}>
<EuiPageTemplate direction="column" offset={0} minHeight={0} restrictWidth={false}>
{!(isFullscreen && (autoApplyEnabled || warningMessages?.length)) && (
<EuiPageSection grow={false} paddingSize="none" color="transparent">
<EuiPageTemplate.Section paddingSize="none" color="transparent">
<EuiFlexGroup
alignItems="flexEnd"
gutterSize="s"
@ -191,20 +185,22 @@ export function WorkspacePanelWrapper({
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageSection>
</EuiPageTemplate.Section>
)}
<EuiPageSection
<EuiPageTemplate.Section
grow={true}
paddingSize="none"
contentProps={{
className: classNames('lnsWorkspacePanelWrapper', {
'lnsWorkspacePanelWrapper--fullscreen': isFullscreen,
}),
className: 'lnsWorkspacePanelWrapper__content',
}}
className={classNames('lnsWorkspacePanelWrapper', {
'lnsWorkspacePanelWrapper--fullscreen': isFullscreen,
})}
color="transparent"
>
<WorkspaceTitle />
{children}
</EuiPageSection>
</EuiPageTemplate.Section>
</EuiPageTemplate>
);
}