0

according to

https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseleave_event

mouseleave is fired when the pointer has exited the element and all of its descendants.

However, on Safari this event is fired as soon the mouse enters the element and is moved inside of it. I created a fiddle

document.getElementById('out').addEventListener('mouseleave', () => console.log('left'));
.outer {
  width: 100px;
  height: 100px;
  background-color: green;
}

.inner {
  width: 50px;
  height: 50px;
  background-color: red;
}
<div class="outer" id="out">
  <div class="inner">
  </div>
</div>

https://jsfiddle.net/hs5ea7cq/

document.getElementById('out').addEventListener('mouseleave', () => console.log('left'));

On Chrome, FireFox on Mac it works as it should. However, Safari emits mouseleave even so it should not.

Is there anything I can do to get the same behavior in Safari as in Chrome or FireFox?

EDIT:

I created a GIF which shows the issue:

https://i.sstatic.net/H8j0F.jpg

8
  • Safari seems to be becoming the new IE... Commented May 10, 2022 at 9:05
  • I can't replicate the issue? The log only fires in safari when the user's mouse leaves the green square. This is the same as Firefox and Chrome on macOS. Commented May 10, 2022 at 9:10
  • @evolutionxbox Thanks for trying. I created a video of the issue and linked it in the description. What Mac version you are on? What Safar version are you using? Commented May 10, 2022 at 10:11
  • Safari 15.4 on macOS 12.3.1 imgur.com/a/27ZkXjf Commented May 10, 2022 at 11:25
  • Can't replicate it on Safari 15.2, macOS 11.6.4 either. What versions are you on @bugAtron9000? Commented May 10, 2022 at 11:42

1 Answer 1

0

It seems to be related to TigerVNC usage. Switching to UltraVNC resolved the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.