Tree onClick event, strange behavior

I am using the onClick event on a tree. It works but the tree node clicked is not highlighted at first click but only from the second click.

Could you provide us completed demo to inspect the issue?
docs.dhtmlx.com/auxiliary_docs__ … pport.html