diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 83389b816..ded41321c 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -301,7 +301,15 @@ define([ // Tooltips UI.clearTooltips = function () { - $('.tippy-popper').remove(); + // If an element is removed from the UI while a tooltip is applied on that element, the tooltip will get hung + // forever, this is a solution which just searches for tooltips which have no corrisponding element and removes + // them. + var win = $('#pad-iframe')[0].contentWindow; + $('.tippy-popper').each(function (i, el) { + if (win.$('[aria-describedby=' + el.getAttribute('id') + ']').length === 0) { + el.remove(); + } + }); }; UI.addTooltips = function () {