post tooltips: fix tooltips appearing over one another.
When viewing a list of post #XXX links, like this: * post #123 * post #456 * post #789 Then moving from bottom to top could cause multiple tooltips to appear over one another. This was because tippy.js tries to keep tooltips active while moving towards them, which meant it was possible to activate a second tooltip while moving towards the first.
This commit is contained in:
@@ -49,6 +49,8 @@ PostTooltip.on_show = async function (instance) {
|
||||
let $target = $(instance.reference);
|
||||
let $tooltip = $(instance.popper);
|
||||
|
||||
hideAll({ exclude: instance });
|
||||
|
||||
// skip if tooltip has already been rendered.
|
||||
if ($tooltip.has(".post-tooltip-body").length) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user