Blazor.Diagrams icon indicating copy to clipboard operation
Blazor.Diagrams copied to clipboard

The MudBlazor menu appears in the top left corner of the container when right clicking on a node component (2)

Open mrakgr opened this issue 2 years ago • 12 comments

I have a MudBlazor menu that is using DiagramCanvas as an activation context which gets triggered on a right click. This works fine when I click on an empty space on a canvas and I've even made it so that I can add nodes using that opened menu. But when I right click on a node, the menu doesn't appear at cursor, but in top left corner instead. Maybe it is getting passed null as the position? Would it be possible to fix that?

https://github.com/Blazor-Diagrams/Blazor.Diagrams/assets/6266635/37f3fd9b-64bc-456f-8ff9-fe8bf704c2a1

mrakgr avatar May 24 '23 13:05 mrakgr

Repo: https://github.com/mrakgr/helix/tree/zoom-error

mrakgr avatar May 24 '23 13:05 mrakgr

For some reason the video doesn't work for me. I will try the repository later

zHaytam avatar May 24 '23 14:05 zHaytam

Strange, it does for me. Maybe you could try a different browser?

mrakgr avatar May 24 '23 16:05 mrakgr

You can see it in this Youtube video at the specified mark. I'll be using Blazor.Diagrams for the project I am doing so check it out!

mrakgr avatar May 24 '23 17:05 mrakgr

Where is the part where you configure the context menu in MudBlazor?

zHaytam avatar May 25 '23 07:05 zHaytam

I only used Blazor for the last third of the video, so a minute or two before the mark I linked to you. During the first 2/3rds I've been trying out Bolero before switching to Blazor and redoing the whole project from scratch as it was too difficult to do UI work in Bolero.

Link: https://github.com/mrakgr/helix/blob/zoom-error/Pages/DiagramTrial.razor

Everything related to Blazor.Diagrams is in this page, the rest are still just the template code.

mrakgr avatar May 25 '23 08:05 mrakgr

Hi, looking at the MudMenu Component they're using OffsetX/OffsetY from the mouse event to position their menu. That means when you click on a node, the relative coordinates to that node are used. You can see that when you click on different positions of the node.
I'm not sure what you can do about it, it doesn't look like there is a way you can change that easily.

314159265meow avatar May 25 '23 08:05 314159265meow

I'll open an issue on the MudBlazor repo and ask them what they think.

mrakgr avatar May 25 '23 08:05 mrakgr

I'll investigate this in the evening, thanks for all the information

zHaytam avatar May 25 '23 11:05 zHaytam

hi @mrakgr same issue with Blazor Menu. Have you got a workaround or a fix?

pfh59 avatar Sep 25 '23 19:09 pfh59

@pfh59 I think what I did was not have it open when clicking on the node. I forgot how I did that by this point though.

mrakgr avatar Sep 26 '23 19:09 mrakgr