Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!