-
Notifications
You must be signed in to change notification settings - Fork 57
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
In recursive structure OnClick doesn't work #119
Comments
Hey devs, I am trying to do the same thing. I have recursive components in a treeview. I want to have a simple menu shown upon a right click of a child component. When run, a right click no longer shows the browser's default right click menu. But it does not show the ContextMenu that I have defined in the child. It just does nothing. No errors or crashes. Unfortunately, I can not my share code but the code provided by bsts6124 is syntactically identical to mine. Is there a different way to implement it in this scenario? Or does this use case break it? Thanks |
Found a -dirty- workaround for this: Once the razor component is loaded, use javascript to change the parent element of the Menu (html element with id == menuid) to the main element. This makes the div use the right anchor for its position. I guess this has the same cause as the other "wrong position" issues. Javascript: razor component: |
You cannot have multiple blazor menus with the same Id. The foreach seams to be creating multiple menus with |
Hey everyone, I was able to get the context menu to show up in a recursive setting by simply defining the context menu in the parent component. Then, in any child/recursive components, I used the contain context menu triggers to reference that context menu. In my previous implementation, I had the context menu defined in the recursive component - which was giving me trouble. It seems that, as @stavroskasidis suggested, it was creating multiple menus with the same ID. Hope this helps. |
I'm using .net 5.0 so Use 1.10.1 version
I use recursive structure because treeview.
and child component OnClick is not work...
mainlayout.razor
this item OnClick is work
Component.Treeview.razor
but this not work
am I must use latest version and .net 6.0? or using wrong way?
The text was updated successfully, but these errors were encountered: