Skip to content

Commit c0e8420

Browse files
committed
Fixes #16922
The styling was applied before the position was updated which caused both `mouseenter` and `mouseleave` to be fired in fairly rapid succession
1 parent 42990fd commit c0e8420

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/web/assets/cp/src/js/CraftTooltip.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class CraftTooltip extends HTMLElement {
168168
};
169169

170170
handleMouseEnter = () => {
171+
console.log('mouseenter');
171172
this.isHovering = true;
172173

173174
if (this.delayTimeout) {
@@ -186,6 +187,7 @@ class CraftTooltip extends HTMLElement {
186187
};
187188

188189
handleMouseLeave = () => {
190+
console.log('mouseleave');
189191
this.isHovering = false;
190192

191193
if (this.delayTimeout) {
@@ -250,6 +252,7 @@ class CraftTooltip extends HTMLElement {
250252
};
251253

252254
show = () => {
255+
autoUpdate(this.triggerElement, this.tooltip, this.update);
253256
Object.assign(this.tooltip.style, {
254257
opacity: 1,
255258
transform: ['left', 'right'].includes(this.getStaticSide())
@@ -259,8 +262,6 @@ class CraftTooltip extends HTMLElement {
259262
pointerEvents: 'auto',
260263
zIndex: 101,
261264
});
262-
263-
autoUpdate(this.triggerElement, this.tooltip, this.update);
264265
this.showing = true;
265266
};
266267

0 commit comments

Comments
 (0)