Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
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 Respuestas
Responde la pregunta

0

Did you try to change

e.stopPropagation()

by

e.stopImmediatePropagation()
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda