Comments (13)
Thanks for more details, I will try to watch and make a PR if find something
from shadcn-vue.
It's not a bug to have the default menu appear again after the custom menu has already appeared😆
However, the issue here is that, after the appearance of the custom menu, right-clicking elsewhere may not always yield the same result. It's possible to get the default menu or the custom menu at a new location. The reason for this behavior is as described in the bug description above and depends on the time gap between right-clicking down and releasing.
Even with a repeated right-click, the outcome may vary, which can be confusing😂
After a custom menu has appeared, if you right-click and hold without releasing until the custom menu closes, and then release the right mouse button after the closing animation is complete, the new custom menu will appear in a new location. This is expected behavior. However, if the right mouse button is released while the closing animation of the previous custom menu is still ongoing, the new custom menu will not appear in a new location; instead, the default menu will appear.
In essence, the problem lies in the relationship between the opening of a new menu and the closing animation of the previous one.
the release time > closing duration :
the release time < closing duration :
Youtube contextmenu :
😆😘
from shadcn-vue.
I also cannot reproduce it on macOS indeed 🤣
And I have a Windows computer, and I'm willing to do whatever you need 😆
from shadcn-vue.
@pinky-pig Hello 👋
Can you try to reproduce this bug on main radix-vue website? Look through code and think this issue is more to Radix-vue codebase, because here used all components from there, just added some styling)
btw, on main website there is no (default contextmenu) always opened custom one 🤔
from shadcn-vue.
Yes If I hit right click fast on that spot
from shadcn-vue.
It seems that when I use a relatively small duration for the 'data-[state=closed]' animation, the custom menu keeps appearing.
![image](https://private-user-images.githubusercontent.com/42307398/296448365-51796e59-518d-46ce-beb9-2db467d2773d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcxMzU2NTUsIm5iZiI6MTcxNzEzNTM1NSwicGF0aCI6Ii80MjMwNzM5OC8yOTY0NDgzNjUtNTE3OTZlNTktNTE4ZC00NmNlLWJlYjktMmRiNDY3ZDI3NzNkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTMxVDA2MDIzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY3NmM1MzFmNGVjZDAwNDg5ODQ4ODZmM2E5NDc1OGNiMzkzNzg1ZmY1ZjU1MGJlOWI4OTUzZmM2ZDdkZDc1ZDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7PnlaSoYDWQtCs74p5eFKTUyzirLjccMpic40WiAUZQ)
🤣🤣
from shadcn-vue.
Now I have verified my hypothesis 😆
As mentioned above, the issue of having two possible outcomes when right-clicking on Windows is due to the 'data-[state=open]' and 'data-[state=closed]' animations.
This situation did not occur on the radix-vue website example but did occur on the shadcn-vue website example. The difference between the two is the style animations.
I demonstrated this in the GIF below. With just the addition of two animations, the example from radix-vue, which originally did not have this bug on StackBlitz, exhibited an anomaly. (For the sake of demonstration, the duration here is set to 0.3s, whereas in shadcn-vue, it is 0.15s, which also causes this issue)
In conclusion, because shadcn-vue only added some styles to radix-vue, the simplest way to address this issue is to minimize the duration of data-[state=closed] or remove the animation effect. Certainly, how to resolve this issue may need to be decided by shadcn-vue core members.
Thanks for the open-source contribution😘. If there is a need for me to submit a pull request, I am also willing to do so 😉
from shadcn-vue.
I don't think this is a bug, for example if you right click on YouTube video, there is custom context menu shown, but when you clicked one more time, it will show you default one. I think this is because of accessibility, @zernonia sorry for tag, but need some final thought from you 🙂
Attached some screenshots, don't look at text, it's my native language (ukrainian) 😁
For example on native context menu you can turn on (Picture in Picture) Arc feature, but YouTube don't give that option)
from shadcn-vue.
Need someone with Windows system, everything works fine on MacOS, can't reproduce it at all 😢
from shadcn-vue.
I couldn't reproduce this bug on the radix-vue website, so I raised the issue here 🤣
Look through code, I initially thought the bug was caused by the 'data-[state=closed]' animate-out animation in shadcn-vue. But I haven't verified it yet 🥲
from shadcn-vue.
Context.Menu.-.shadcn-svelte.-.Google.Chrome.2024-01-23.06-27-12.mp4
from shadcn-vue.
你好,兄弟,我也出现这个问题了,你是把动画删掉就能解决问题了吗?
Hello brother, I also have this problem. Can you solve the problem by deleting the animation css?
and I also is macos
Screen-2024-05-06-184053.1.mp4
from shadcn-vue.
I got it. I just deleted the css " data-[state=closed]:animate-out " attribute in the "ContextMenuContent.vue" file and it works. I hope it works for you.
from shadcn-vue.
Related Issues (20)
- [Feature]: Include PIN Input to Auto Form
- [Feature]: Add option for icons to the Auto Form inputs
- [Bug]: Form not submitting HOT 3
- [Bug]: npx shadcn-vue@latest Get npm ERR! Invalid Version: HOT 5
- [Bug]: v0.10.5 - Unable to add components using npx HOT 21
- [Bug]: use TooltipProvider in Blocks/Dashboard03,05,06,07
- [Bug]: Pagination component directory not created in latest release HOT 1
- [Bug]: There's no way to manually focus the textarea HOT 2
- [Bug]: Updated date picker does not let user choose month and year HOT 4
- [Docs]: the broken navigation links for the code examples under the "Form" tab HOT 6
- [Feature]: NumberField
- [Feature]: Create internal frameworks templates for the CLI HOT 1
- [Feature]: remove the need for multiple <script> tags from a single component. HOT 2
- [Bug]: Error in DropdownMenuRadioItem HOT 2
- [Bug]: DonutChart's legend is not shown HOT 4
- [Bug]: Switch component applying wrong prop types HOT 2
- [Bug]: HTML expects colspan instead of col-span HOT 3
- [Bug]: when adding stepper getting: Invalid configuration found in components.json HOT 2
- [Feature]: Providing a way to update components from remote registry
- [Bug]: Examples > forms 404 error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shadcn-vue.