mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
parent
fe581a3640
commit
e2206a7151
@ -26,7 +26,9 @@ import AsyncEsmComponent from 'src/components/AsyncEsmComponent';
|
|||||||
import { getChartKey } from 'src/explore/exploreUtils';
|
import { getChartKey } from 'src/explore/exploreUtils';
|
||||||
import { runAnnotationQuery } from 'src/components/Chart/chartAction';
|
import { runAnnotationQuery } from 'src/components/Chart/chartAction';
|
||||||
import CustomListItem from 'src/explore/components/controls/CustomListItem';
|
import CustomListItem from 'src/explore/components/controls/CustomListItem';
|
||||||
import ControlPopover from '../ControlPopover/ControlPopover';
|
import ControlPopover, {
|
||||||
|
getSectionContainerElement,
|
||||||
|
} from '../ControlPopover/ControlPopover';
|
||||||
|
|
||||||
const AnnotationLayer = AsyncEsmComponent(
|
const AnnotationLayer = AsyncEsmComponent(
|
||||||
() => import('./AnnotationLayer'),
|
() => import('./AnnotationLayer'),
|
||||||
@ -114,6 +116,11 @@ class AnnotationLayerControl extends React.PureComponent {
|
|||||||
|
|
||||||
removeAnnotationLayer(annotation) {
|
removeAnnotationLayer(annotation) {
|
||||||
const annotations = this.props.value.filter(anno => anno !== annotation);
|
const annotations = this.props.value.filter(anno => anno !== annotation);
|
||||||
|
// So scrollbar doesnt get stuck on hidden
|
||||||
|
const element = getSectionContainerElement();
|
||||||
|
if (element) {
|
||||||
|
element.style.setProperty('overflow-y', 'auto', 'important');
|
||||||
|
}
|
||||||
this.props.onChange(annotations);
|
this.props.onChange(annotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import Popover, {
|
|||||||
} from 'src/components/Popover';
|
} from 'src/components/Popover';
|
||||||
|
|
||||||
const sectionContainerId = 'controlSections';
|
const sectionContainerId = 'controlSections';
|
||||||
const getSectionContainerElement = () =>
|
export const getSectionContainerElement = () =>
|
||||||
document.getElementById(sectionContainerId)?.lastElementChild as HTMLElement;
|
document.getElementById(sectionContainerId)?.lastElementChild as HTMLElement;
|
||||||
|
|
||||||
const getElementYVisibilityRatioOnContainer = (node: HTMLElement) => {
|
const getElementYVisibilityRatioOnContainer = (node: HTMLElement) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user