Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
mouseleave event on html tag getting triggered on scrolling the page

I have added mouseleave event on the current page HTML tag inside useEffect(didMount) of my react application and the expected behavior is that the event should be triggered when the cursor leaves the window. But the event is sometimes getting triggered when the user is normally scrolling through the page.

Here's the code snipped which I have added.

const pageHtml = document.getElementsByTagName('html')[0];
const mouseLeaveHandler = () => {
  console.log('Left::');
};

pageHtml.addEventListener('mouseleave', mouseLeaveHandler);

I just want to show a popup only when the mouse pointer leaves the current browser window. So, any help related to this would be appreciated.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda