While working on one of my project, I noticed that if the title attribute of any elements is in multiple lines, then the mouseleave
event gets triggered when I hover over the title tooltip.
Is this a known issue? If yes, how do I fix it?
Below is an example showing the issue.
let count = 0;
function test(x) {
//console.log(x.style.fontSize)
count++
document.getElementById("count").innerText = count;
}
#test {
width: 100vw;
height: 40vh;
border: 1px solid;
}
<div>
<p>MouseLeave Count:
<span id="count">0</span>
</p>
<em> (hover inside box below, hold for tooltip, then hover over tooltip)</em>
<p id="test" onmouseleave="test(this)" title="This is a
multi line title"></p>
</div>
Note that, I see this behavior in
- Microsoft Edge Version 114.0.1823.43 (Official build) (64-bit)
- Chrome Version 112.0.5615.138 (Official Build) (64-bit)
Works fine in:
- Firefox 114.0.1 (64-bit)
pointer-events: none;
so to say. – EudemoniasetTimeout
in themouseleave
for 2 seconds and usingclearInterval
in themouseenter
event is the user comes back within 2 seconds – Cordwood