Skip to content

[Timeline] itemover & itemout fired multiple times in HTML items

JSBin: http://jsbin.com/fixegibizu/1/edit?html,console,output

As you can see, the events are fired when you move the cursor around the HTML item.

This also impacts HTML tool-tips from #2498

Explanation of why: (source) PR 2498 Comment "The mouseover/mouseout event is being fired on child elements. In this case it was something like

<div class='vis-item'>
    <h1>HTML</h1>
    Text
</div>

So when you hovered over the <h1> element, there was a new element under the cursor, which fires mouseout, followed by its related mouseover. This is expected; however, all the code handling those events don't care about the specific element, only the 'item' which they are in. (Reference: ItemSet.js:1874 and ItemSet.js:1896) So tool-tips will be moved, and 'itemover'/'itemout' will be emitted when the cursor is still over the same item."