import React, { memo } from 'react'; import { Popover, Position, Classes } from '@blueprintjs/core'; import { saveInvoke } from 'utils'; const POPPER_MODIFIERS = { preventOverflow: { boundariesElement: 'viewport' }, }; function ContextMenu(props) { const { bindMenu, isOpen, children, onClosed, popoverProps } = props; const handleClosed = () => { requestAnimationFrame(() => saveInvoke(onClosed)); }; const handleInteraction = (nextOpenState) => { if (!nextOpenState) { // Delay the actual hiding till the event queue clears // to avoid flicker of opening twice requestAnimationFrame(() => saveInvoke(onClosed)); } }; return (