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

124
Views
Evento onTouchStart que activa el evento Parent OnClick en react js

Hola, estoy creando un calendario usando reactjs con Custom Drag and Drop. Tengo un problema con los móviles Ipad y Touch. mi código funciona perfectamente en el escritorio, pero si abro la herramienta de desarrollo de Chrome y cambio la resolución de pantalla a la tableta de 768px. mis eventos tampoco funcionan en él. Por favor, ayuda, he usado cursor:pointer y e.stopPropagation() en el evento principal y en el evento secundario, pero no funcionó. yo uso onTouchStart={this.handleTouchStart}

aquí está el código que estoy usando El evento principal es

 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(); }

El evento hijo es

 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

¿Intentaste cambiar?

 e.stopPropagation()

por

 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!