Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
919 stars 176 forks source link

DOM is not updating after mouse click event #333

Closed Kbarude closed 10 months ago

Kbarude commented 11 months ago

Blazor Web assembly --> package : z.Blazor.Diagram

@if(ShowComponent){ //Load table }

@code{ public bool ShowComponent { get; set; } diagram.MouseClick += MouseClickEvent; private void MouseClickEvent(Model sender,MouseEventArgs e) { ShowComponent=true; } }

mouse click event is working and showcomponent property is setting to true, but this property change is not render on DOM, any variables inside the mouseclick is not render on DOM. What is the wrong in this code, please let me know


zHaytam commented 11 months ago

Hi, try adding InvokeAsync(StateHasChanged); after ShowComponent=true;.