Im using vanilla JS and I am getting a really annoying issue where if you hover the scrollbar of an element that has a mouseleave event listener the mouseleave will be called.
However, if you use the mouse wheel to scroll before hovering the element you will then be able to interact with the scrollbar without any issue at all.
This is the javascript:
var mainMenu = document.getElementById("mainTable");
mainMenu.addEventListener("mouseleave", function(evt) {
console.log("exited");
});
This is the element
<table id="mainTable" style="overflow-y:scroll;">
<tbody>
<tr>1</tr>
<tr>2</tr>
<tr>3</tr>
<tr>4</tr>
<tr>5</tr>
<tr>6</tr>
</tbody>
</table>
I believed that mouseleave worked with direct descendants of the element with the listener, so even without having to scroll the first time the scrollbar should act as a descendant.