jquery-powertip
jquery-powertip copied to clipboard
Nested titles confuse powertip
The library does not seem to have a detection of nested HTML elements with titles, it seems.
Minimal example:
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.powertip.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/jquery.powertip.min.css" rel="stylesheet" />
<script type="text/javascript">
$(document).ready(function() {
// Fire up PowerTip:
$("[title]").powerTip({ smartPlacement: true });
});
</script>
</head>
<body>
<ul>
<li title="parent">
Parent element
<ul>
<li title="child">Child element</li>
</ul>
</li>
</ul>
</body>
</html>
You might see how hovering the child element confuses the tooltip.
Thank you for the bug report. As well as the helpful test case.
I can reproduce this issue with your example code. Placing the mouse cursor over the child element causes the tooltip for the child to open, then close, then the tooltip for the parent opens.
I believe that this particular case is event bubbling causing the parent to be queued after the child. I could probably just capture or stop bubbling. I'll look into it.
Thank you. :-)