GithubHelp home page GithubHelp logo

Comments (13)

romanhrynevych avatar romanhrynevych commented on June 15, 2024 4

Thanks for more details, I will try to watch and make a PR if find something ☺️

from shadcn-vue.

pinky-pig avatar pinky-pig commented on June 15, 2024 3

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 :

context-menu-normal

the release time < closing duration :

context-menu-bug

Youtube contextmenu :

context-menu-youtube

😆😘

from shadcn-vue.

pinky-pig avatar pinky-pig commented on June 15, 2024 2

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.

romanhrynevych avatar romanhrynevych commented on June 15, 2024 1

@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.

sadeghbarati avatar sadeghbarati commented on June 15, 2024 1

Yes If I hit right click fast on that spot

from shadcn-vue.

pinky-pig avatar pinky-pig commented on June 15, 2024 1

7d707e7f77a661de0d065febd33e5e06

It seems that when I use a relatively small duration for the 'data-[state=closed]' animation, the custom menu keeps appearing.

image

🤣🤣

from shadcn-vue.

pinky-pig avatar pinky-pig commented on June 15, 2024 1

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)

The code in the GIF

c8878fed7cc770d42d5bb1594f5f4fc0

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.

romanhrynevych avatar romanhrynevych commented on June 15, 2024

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) 😁
image
image

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.

romanhrynevych avatar romanhrynevych commented on June 15, 2024

Need someone with Windows system, everything works fine on MacOS, can't reproduce it at all 😢

from shadcn-vue.

pinky-pig avatar pinky-pig commented on June 15, 2024

f5b261db2f01d3655bf348a1adaf97f7

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.

sadeghbarati avatar sadeghbarati commented on June 15, 2024

shadcn-svelte Context Menu

Context.Menu.-.shadcn-svelte.-.Google.Chrome.2024-01-23.06-27-12.mp4

from shadcn-vue.

KelvinTee58 avatar KelvinTee58 commented on June 15, 2024

你好,兄弟,我也出现这个问题了,你是把动画删掉就能解决问题了吗?

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.

KelvinTee58 avatar KelvinTee58 commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.