ui
ui copied to clipboard
fix(components): context menu position not updating when reopening
Currently, when we open a context menu and then right click somewhere else in the trigger, the opening animation plays again but the context menu position is not updated to where our last click was. (See attached recording)
This happens because Radix waits for our exit animation to finish before repositioning, but the menu is opened again before the aniomation finishes so the position is never updated. See this issue for more details: https://github.com/radix-ui/primitives/issues/2611
The fix to this is removing the exit animations from ContextMenuContent and ContextMenuSubContent.
Demonstration of the bug:
https://github.com/shadcn-ui/ui/assets/29822201/666e4744-4e9c-46b9-a867-57f2da4c1318