Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

ClickOutsideWrapper class

Signature

typescript
export declare class ClickOutsideWrapper extends PureComponent<Props, State> 

Import

typescript
import { ClickOutsideWrapper } from '@grafana/ui';

Properties

PropertyModifiersTypeDescription
defaultPropsstatic{
includeButtonPress: boolean;
parent: Window & typeof globalThis;
useCapture: boolean;
}
myRefReact.RefObject<HTMLDivElement>
onOutsideClick(event: any) => void
state{
hasEventListener: boolean;
}

Methods

MethodModifiersDescription
componentDidMount()
componentWillUnmount()
render()

defaultProps property

Signature

typescript
static defaultProps: {
        includeButtonPress: boolean;
        parent: Window & typeof globalThis;
        useCapture: boolean;
    };

myRef property

Signature

typescript
myRef: React.RefObject<HTMLDivElement>;

onOutsideClick property

Signature

typescript
onOutsideClick: (event: any) => void;

state property

Signature

typescript
state: {
        hasEventListener: boolean;
    };

componentDidMount method

Signature

typescript
componentDidMount(): void;

Returns:

void

componentWillUnmount method

Signature

typescript
componentWillUnmount(): void;

Returns:

void

render method

Signature

typescript
render(): JSX.Element;

Returns:

JSX.Element