From 87b6f59bf0718d4817472c463998ab68001a6871 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 16 Jul 2020 12:53:08 -0500 Subject: [PATCH] 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. --- app/javascript/src/javascripts/post_tooltips.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/javascript/src/javascripts/post_tooltips.js b/app/javascript/src/javascripts/post_tooltips.js index da8b06776..8daf42234 100644 --- a/app/javascript/src/javascripts/post_tooltips.js +++ b/app/javascript/src/javascripts/post_tooltips.js @@ -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;