Disposing the component on click throws an exception
I am using the context menu to open a modal window. When I click on the menu item the component throws an exception.
4 comments
ADMIN
Marin Bratanov
Posted on:22 Jan 2021 20:49
Hello Ivan,
We are aware of this issue and it will be fixed as soon as possible. Maye as soon as next week.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Ivan
Posted on:21 Jan 2021 12:11
I've checked other examples of context menu, even the simplest https://demos.telerik.com/blazor-ui/contextmenu/overview also raises an error
Ivan
Posted on:21 Jan 2021 12:03
Hello and thanks for your attention! Unfortunately, adding a delay only solves the problem in a specific case, but for example, if the context menu is called from grid lines, the error repeats and adding a delay does not help. The error is reproduced in your example of integrating the context menu into the grid, where there is no call to the modal window.
Open the console and click on the context menu of the record line
ADMIN
Svetoslav Dimitrov
Posted on:21 Jan 2021 11:24
Hello Ivan,
The reason behind the issue is the sequence of Blazor points:
Execute click logic for context menu item that opens a modal, forcing the menu to dispose
On hiding the menu, the focusout handler of the menu is triggered
Menu is disposed and the DotNetInstance is destroyed
Menu_Focusout handler tries to execute on already destroyed dotnetinstance
A workaround solution would be to add a delay before opening the modal window so that the Menu_Focusout handler has already passed.
Regards,
Svetoslav Dimitrov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.