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

170
Visualizações
How to keep tracking mouse events even when some text is marked up

I have a few mouse event listeners bound to each class instance that draws a canvas. It should listen to changes in mouse events when certain events happen. And it needs to track the mouse events even when the mouse is clicked and moved around the document.

The problem is that sometimes when the mouse is clicked and moving around the screen, it marks up some text, or even just blank space. Then when I keep moving the mouse, the browser displays the "forbidden action" symbol and stops tracking the events.

This is an image of the problem: broken listeners

Each canvas is a class instance and has its own listeners, this is how I set it inside the class:

this.canvas.addEventListener('mousedown', (e) => {
    // code
    }
});

document.documentElement.addEventListener('mouseout', (e) => {
    // code 
    }
});

document.documentElement.addEventListener('mouseover', (e) => {
    // code
    }
});

document.documentElement.addEventListener('mouseup', (e) => {           
    // code
    }            
});
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