Using the following two components, clicking the button twice in quick succession will throw the following exception: ,"Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: No DOM element with id 'PlotlyChart-1695005480' exists on the page.
Error: No DOM element with id 'PlotlyChart-1695005480' exists on the page."
This can also occur if you navigate away from the page while a plot is lazy loading, although I was able to work around that by intercepting the OnLocationChanging event from the NavigationManager and waiting for the chart to finish loading before navigating away.
This causes a lot of issues if you want to embed a plotly chart in an expandable components, like a tree or grid.
Using the following two components, clicking the button twice in quick succession will throw the following exception: ,"Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: No DOM element with id 'PlotlyChart-1695005480' exists on the page. Error: No DOM element with id 'PlotlyChart-1695005480' exists on the page."
This can also occur if you navigate away from the page while a plot is lazy loading, although I was able to work around that by intercepting the OnLocationChanging event from the NavigationManager and waiting for the chart to finish loading before navigating away.
This causes a lot of issues if you want to embed a plotly chart in an expandable components, like a tree or grid.
Home.razor
Plot.razor: