We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Click event is not strongly typed

Hi there,

I have a diagram - that renders fine and have set up the (click) handler as follows:















My event handler looks like this:

  handleClick(args: IClickEventArgs): void {


    if (args.element instanceof Node) {

      console.log('We got a Node');



When I look at the output of the console.log I can see that the type of the element is Node. However, the if statement is never true. Instead it shows that it is type object. Why would this be please?

1 Reply

BM Balasubramanian Manikandan Syncfusion Team December 9, 2022 02:04 PM UTC

We suspect that you would have not imported Node in your sample. So only the if conditions fails in the click event. We have provided a sample to achieve your requirement. Refer to the below mentioned code example and sample.

Code Snippet:

import {


} from '@syncfusion/ej2-diagrams';



Live Chat Icon For mobile
Up arrow icon