Closed mrakgr closed 1 year ago
<MudCard Class="pa-8 ma-0" Style="width: 300px;"
@oncontextmenu:stopPropagation>
<MudTextField T="string"
DisableUnderLine="true"
Variant="Variant.Outlined" Lines="5"
@bind-Value="@Node.Text"
@onmousedown:stopPropagation @onmousemove:stopPropagation
/>
@foreach (var port in Node.Ports)
{
<PortRenderer Port="port"/>
}
</MudCard>
Suppressing it like this is good enough for the time being, though I am wondering if it would be possible to fix the positioning issue.
Hey, glad you figured it out. It is necessary to stop the propagation of events from other controls in order to stop these unwanted behaviors (since events travel from child to parent).
Can you create another issue for the positioning?
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?Ideally, I'd like to suppress its activation when clicking on a node, but maybe I'd need to implement a different kind of system for that.