palantir/blueprint

Can we have a ContextMenu2 with an arrow like we have in Popover2? Arrow modifier doesn't work for me.

Open

#4,865 创建于 2021年8月20日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)TypeScript (20,263 star) (2,167 fork)batch import
P2Package: popover2Type: feature requesthelp wanted

描述

Environment

  • Package version(s): "@blueprintjs/core": "^3.10.0", "@blueprintjs/popover2": "^0.11.1",
  • Browser and OS versions: MacOS Catalina Version 10.15.7 Browser Firefox 91.0.1

Question

I would need a context menu but with an arrow just like a popover (screenshot below), which points to the clicked screen coordinates on the clicked component.

I saw two solutions:-

  1. Opening Popover2 on right-click
  2. Adding arrow: { enabled: true } modifier as a prop in ContextMenu2

But AFAIK, opening Popover2 with right-click isn't possible according to the official documentation, right?

And, providing this modifier didn't work.

<ContextMenu2
  modifiers={{ arrow: {enabled: true} }}
  content={<p>hello world</p>}
>
  Click me to open menu
</ContextMenu2>

image

Can someone please share a snippet in JS? Thanks a lot.

贡献者指南