Treetable misses mouse events when continually updating items

While updating an item (or just calling refresh) continuously, sometimes mouse clicks are lost/ignored. We are updating a treetable “realtime” and sometimes when clicking an item in the tree, it doesn’t get selected. See this example: Code Snippet

It’s really obvious if you click the mouse, wait a few seconds, then release - item doesn’t get selected. Without the update/refresh being called it works fine.


I’m afraid it’s a normal befavior if cells are repainted faster than the click can happen.
Every refresh() repaints table cells, which means the old elements inside are destroyed, and the new content is provided according to the tempate of the column.
In HTML, a native click event will fire in the following sequence: mousedown, mouseup, click.
In the described scenario

click the mouse, wait a few seconds, then release

Mousedown will triggered on one node, then mouseup will fire for the button element that was created after repainting, so even the native click event won’t be triggered.
Please, check the following demo with native events: Code Snippet
The template here is set as a function which adds a unique ID for every button. You can check the log to see which ID is available in every event handler.