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

116
Views
onTouchStart event triggering Parent OnClick Event in react js

Hey i'm Creating a Calendar using reactjs with Custom Drag and Drop . I'm facing issue on Ipad and Touch mobiles . my code is working perfect on desktop but if I open chrome dev tool and change screen resolution to 768px tablet . my events doesn't work in it either. please Help i've used cursor:pointer and e.stopPropagation() in parent event and child event both but didn't work . i use onTouchStart={this.handleTouchStart}

here is the code i'm using The parent Event is

  Sectiondoubletap(e) {
    debugger
    var now = new Date().getTime();
    var timesince = now - this.state.mylatesttap;
    if((timesince < 300) && (timesince > 0)){
 
     // double tap checking
     this._handleDoubleClickSpaltenBody(e)
     console.log("Sectiondoubletap worked")
 
    }
 
    this.state.mylatesttap = new Date().getTime();
 
 }

The child event is

  handleTouchStart(ev) {
    
    
    ev.stopPropagation();

    console.log("handleTouchStart");
    var now = new Date().getTime();
    var timesince = now - this.state.mylatesttap;
    // checking double tap
    if((timesince < 300) && (timesince > 0)){
 
     // double tap checking  
     this._handleDoubleClickItem(ev)
     console.log("Appoinmentdoubletap worked")
 
    }else{
      this.handleDrag(ev);
    }
 
    this.state.mylatesttap = new Date().getTime();

    

   
  }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Did you try to change

e.stopPropagation()

by

e.stopImmediatePropagation()
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!