enonic / app-contentstudio

Content Studio of Enonic XP
GNU General Public License v3.0
11 stars 4 forks source link

Remove tooltip if target element was replaced #7638

Closed edloidas closed 3 weeks ago

edloidas commented 3 weeks ago

When we click the element with tooltip, we add a timeout to remove it. We check pick the event's target or currentTarget to check if it's the same lastTarget (of the tooltip). If the element with tooltip was clicked, we remove the tooltip. In some cases, we might change the inner content of the element (e.g. replace the svg icon in the button). Thus, checking if last tooltip target equals or contains thetarget is not enough, we must also check the currentTarget: target may change, but the element still exists.