fix function editor in Grafana 6.4, closes #810

This commit is contained in:
Alexander Zobnin
2019-10-09 14:09:56 +03:00
parent 9cf13230eb
commit a652eafc46

View File

@@ -3,7 +3,7 @@ import React from 'react';
import { FunctionDescriptor, FunctionEditorControlsProps, FunctionEditorControls } from './FunctionEditorControls';
// @ts-ignore
import { PopperController, Popper } from '@grafana/ui';
import { PopoverController, Popover } from '@grafana/ui';
interface FunctionEditorProps extends FunctionEditorControlsProps {
func: FunctionDescriptor;
@@ -66,12 +66,12 @@ class FunctionEditor extends React.PureComponent<FunctionEditorProps, FunctionEd
render() {
return (
<PopperController content={this.renderContent} placement="top" hideAfter={300}>
<PopoverController content={this.renderContent} placement="top" hideAfter={300}>
{(showPopper, hidePopper, popperProps) => {
return (
<>
{this.triggerRef && (
<Popper
<Popover
{...popperProps}
referenceElement={this.triggerRef.current}
wrapperClassName="popper"
@@ -101,7 +101,7 @@ class FunctionEditor extends React.PureComponent<FunctionEditorProps, FunctionEd
</>
);
}}
</PopperController>
</PopoverController>
);
}
}