Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function (event) {
let offset = parseInt(element.dataset.rightOffset);
let placement = element.dataset.placement === 'contextual' ? Corner.TOP_LEFT : Corner.BOTTOM_LEFT;
menu.setAbsolutePosition(event.clientX, event.clientY);
menu.setAnchorMargin({left: offset});
menu.setAnchorCorner(placement);
menu.open = !menu.open;
event.stopPropagation();
};
}