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

fix(components): resolve context menu positioning issue on subsequent right-clicks #6155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emre-turan
Copy link

Fixes #6117

Issue

The ContextMenu component wasn't updating its position when right-clicking in a new location while the menu was already open. This was caused by exit animations interfering with position recalculation.

Solution

Removed data-[state=closed]:animate-out from both style variants of the ContextMenu component to prevent animation conflicts during position updates. This allows the menu to properly reposition itself on subsequent right-clicks.

Changes

  • Removed exit animations from default style variant
  • Removed exit animations from new-york style variant
  • Maintained entrance animations for smooth UX
  • Updated registry build

Testing

✅ Context menu opens at correct position on initial right-click
✅ Context menu updates position correctly on subsequent right-clicks
✅ Animations still work smoothly for menu entrance
✅ Tested in both style variants

Breaking Changes

None - This is a bug fix that maintains existing functionality while improving positioning behavior.

Copy link

vercel bot commented Dec 22, 2024

@emre-turan is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

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

Successfully merging this pull request may close these issues.

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