UNPKG

@atlaskit/select

Version:

Select allows users to make a single selection or multiple selections from a list of options.

23 lines 867 B
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer'; /** * Functional component wrapper around `useNotifyOpenLayerObserver`. * * This is needed as PopupSelect is a class component, which cannot use hooks directly. * * Even though the internal `Select` component (used internally by `PopupSelect`) also registers with * the OpenLayerObserver, we are also registering `PopupSelect` as well, to allow the observer to close * the `PopupSelect`'s outer popup. * * This will technically count as 2 open layers, however the specific count is not important - the main * concern is that the observer can know if there are _any_ open layers (0, or 1+), and how to close them. */ export function NotifyOpenLayerObserver({ isOpen, onClose }) { useNotifyOpenLayerObserver({ isOpen, onClose }); return null; }