mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Fix tooltip not appearing/disapearing when attribute is removed
This commit is contained in:
@ -136,6 +136,13 @@ new MutationObserver((mutations: MutationRecord[]) => {
|
||||
if (target.hasAttribute("tooltip")) {
|
||||
target.addEventListener("mouseover", tooltipMouseover);
|
||||
target.addEventListener("mouseout", tooltipMouseout);
|
||||
if (target.matches(":hover")) {
|
||||
target.dispatchEvent(new Event("mouseover", { bubbles: true }));
|
||||
}
|
||||
} else if (tooltips.has(target)) {
|
||||
// Remove corresponding tooltip
|
||||
tooltips.get(target).remove();
|
||||
tooltips.delete(target);
|
||||
}
|
||||
}
|
||||
}).observe(document.body, {
|
||||
|
Reference in New Issue
Block a user