AnsweredAssumed Answered

nodeClick event is called several times

Question asked by qwertz on Jul 18, 2017



I have defined a click handler that is called when a user single-clicks on a node in the document list. I thought that this function is called only once but the more often I click on a folder node, the more often the handler is called. On the first click it is called twice, on the second it's called 6 times, on the third 10 times, etc.. (These numbers are not consistent and different every time I refresh the page but it always starts with 2 calls)

Here is the HTML:



and this is my click handler:

    onNodeClicked(event: any): void {
        console.log('node clicked');

    private stopPropagation(event: any): void {
        event = event || window.event;
        if (typeof event.stopPropagation !== 'undefined') {
        } else {
            event.cancelBubble = true;

The problem exists with or without calling the stopPropagation() function and is present on IE, Firefox and Chrome.

Do you have an idea how I can get onNodeClicked() called only once when a user clicks on a row of the document list?