Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showContextMenu only works the first time #5949

Closed
adidahiya opened this issue Feb 15, 2023 · 0 comments · Fixed by #5952
Closed

showContextMenu only works the first time #5949

adidahiya opened this issue Feb 15, 2023 · 0 comments · Fixed by #5952
Assignees

Comments

@adidahiya
Copy link
Contributor

adidahiya commented Feb 15, 2023

Environment

  • Package version(s): @blueprintjs/popover2
  • Operating System:
  • Browser name and version:

Code Sandbox

https://codesandbox.io/s/romantic-cloud-1y8kmx?file=/src/Popover2Example.tsx

Steps to reproduce

  1. call showContextMenu() more than once

Actual behavior

context menu is only displayed the first time, but ignored on subsequent calls to this imperative API

2023-02-15 13 07 34

Expected behavior

the context menu should show every time when calling showContextMenu()

Possible solution

This can be worked around by calling hideContextMenu() in the onClose handler:

showContextMenu({
  content: menu,
  targetOffset: {
    left: e.clientX,
    top: e.clientY,
  },
  onClose: hideContextMenu,
});

... but that shouldn't be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant