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

[bug]: ContextMenu fails to update location on right-click to a new location after opening #6117

Open
2 tasks done
programming-with-ia opened this issue Dec 18, 2024 · 0 comments · May be fixed by #6155
Open
2 tasks done
Labels
bug Something isn't working

Comments

@programming-with-ia
Copy link

Describe the bug

Title: ContextMenu fails to update location on right-click to a new location after opening

Description:

When using the ContextMenu component in ShadCN UI, the context menu correctly opens when right-clicking. However, if the user right-clicks again at a different location within the same container, the context menu remains at the previous location instead of updating to the new one. The position is not recalculated when the context menu is opened at a new location.

Steps to Reproduce:

  1. Right-click anywhere in the container to open the ContextMenu.
  2. Without closing the context menu, right-click again at a different location within the container.
  3. Notice that the context menu does not update its position and remains at the previous location.

Expected Behavior:

When right-clicking in a new location, the context menu should update its position to the new click location and display accordingly.

Actual Behavior:

The context menu stays at the previous location and does not update its position.

Affected component/components

ContextMenu

How to reproduce

Steps to Reproduce:

  1. Right-click anywhere in the container to open the ContextMenu.
  2. Without closing the context menu, right-click again at a different location within the container.
  3. Notice that the context menu does not update its position and remains at the previous location.

Expected Behavior:

When right-clicking in a new location, the context menu should update its position to the new click location and display accordingly.

Actual Behavior:

The context menu stays at the previous location and does not update its position.

Codesandbox/StackBlitz link

https://v0.dev/chat/ORkigkeuMgZ

Logs

No response

System Info

Windows 11, Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant