Fix JS roots assertion when clicking on an element