fix function editor in Grafana 6.4, closes #810
This commit is contained in:
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import { FunctionDescriptor, FunctionEditorControlsProps, FunctionEditorControls } from './FunctionEditorControls';
|
import { FunctionDescriptor, FunctionEditorControlsProps, FunctionEditorControls } from './FunctionEditorControls';
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PopperController, Popper } from '@grafana/ui';
|
import { PopoverController, Popover } from '@grafana/ui';
|
||||||
|
|
||||||
interface FunctionEditorProps extends FunctionEditorControlsProps {
|
interface FunctionEditorProps extends FunctionEditorControlsProps {
|
||||||
func: FunctionDescriptor;
|
func: FunctionDescriptor;
|
||||||
@@ -66,12 +66,12 @@ class FunctionEditor extends React.PureComponent<FunctionEditorProps, FunctionEd
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<PopperController content={this.renderContent} placement="top" hideAfter={300}>
|
<PopoverController content={this.renderContent} placement="top" hideAfter={300}>
|
||||||
{(showPopper, hidePopper, popperProps) => {
|
{(showPopper, hidePopper, popperProps) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.triggerRef && (
|
{this.triggerRef && (
|
||||||
<Popper
|
<Popover
|
||||||
{...popperProps}
|
{...popperProps}
|
||||||
referenceElement={this.triggerRef.current}
|
referenceElement={this.triggerRef.current}
|
||||||
wrapperClassName="popper"
|
wrapperClassName="popper"
|
||||||
@@ -101,7 +101,7 @@ class FunctionEditor extends React.PureComponent<FunctionEditorProps, FunctionEd
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</PopperController>
|
</PopoverController>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user