@atlaskit/select
Version:
Select allows users to make a single selection or multiple selections from a list of options.
28 lines (27 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NotifyOpenLayerObserver = NotifyOpenLayerObserver;
var _useNotifyOpenLayerObserver = require("@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.
*/
function NotifyOpenLayerObserver(_ref) {
var isOpen = _ref.isOpen,
onClose = _ref.onClose;
(0, _useNotifyOpenLayerObserver.useNotifyOpenLayerObserver)({
isOpen: isOpen,
onClose: onClose
});
return null;
}