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

152
Visualizações
How to Prevent button click action on mobile touch (scroll for example)

I have a website that uses third party button, that works great on PC. However on mobile when you just touch it (to scroll through it for example), it activates and does the button action.

Is there any idea how could I fix it and prevent "clicking" action while just touching the screen on mobile? Thanks a lot

Other buttons dont have this issue and code looks good, I'm stuck - tried other solutions like touch-callout or touch-action: none in css, but it's not fixing the issue

<div class="buttonspopup-actions">
        <a class="button go-button" href="#">Button</a>
</div>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Have you tried adding conditional to events?

    if(screen.width<480){
      button.addEventListener("click", function(e){
      e.preventDefault();
      //do something else
    });
    }

Or maybe use swipe events library like https://api.jquerymobile.com/swipe/

about 4 years ago · Juan Pablo Isaza Relatório
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