Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
In Chrome and Edge, why `mousemove` event is triggered when CLICKING on an inactive browser window?

In my FE, there is an element that listens to mousemove event:

<div (mousedown)="onMouseDown($event)" (mousemove)="onMouseMove($event)">
    ...
</div>

The two functions prints out related strings in console, like "onMouseDown triggered" and "onMouseMove is triggered"

Here is the issue and the steps to reproduce it:

  1. Open my app in a browser window (Either Chrome or Microsoft Edge, but not Firefox).
  2. Switch to another window (another program, folder and so on), after which the browser window of my app should be inactive.
  3. Click on the element mentioned above that listens to mousemove event. Just click on it while the browser window is still inactive. Don't switch back to this window beforehand.
  4. In console, I can see a string "onMouseMove is triggered" is printed.

Why a clicking operation will trigger mousemove event?

This happens in Chrome and Microsoft Edge, but not on Firefox.

Looks like a bug in the browsers' end. Anyone else has seen it before and know how to solve it?

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda