Completed
Last Updated: 28 Jan 2021 09:51 by ADMIN
Release 2.21.1
Ivan
Created on: 21 Jan 2021 11:13
Category: ContextMenu
Type: Bug Report
1
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.

https://demos.telerik.com/blazor-ui/contextmenu/integration

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:
  1. Execute click logic for context menu item that opens a modal, forcing the menu to dispose
  2. On hiding the menu, the focusout handler of the menu is triggered
  3. Menu is disposed and the DotNetInstance is destroyed
  4. 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/.