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

112
Vistas
How to let long press event bubble up in react native?

How do I make the long press event bubble up such that both triggered 1 and triggered 2 are printed?

  <Pressable style={styles.press2} onLongPress={() => { console.log('triggered 2') }}>
    <Text>Look Down</Text>
    <ScrollView>
      <Pressable style={{styles.press1}} onLongPress={() => { console.log('triggered 1') }}>
        <Text>click me</Text>
      </Pressable>
    </ScrollView>
  </Pressable>

I read this answer but I really don't understand it

Edit: is there any way to solve this without importing another package?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't think this is easily doable without a 'hacky' enable trick. I would personally use a LongPressGestureHandler from react-native-gesture-handler.

They have a simultaneousHandlers prop which makes multiple handlers work at the same time, so you could do something like this:

const childHandlerRef = useRef(null);

<LongPressGestureHandler simultaneousHandlers={childHandlerRef}>
  <View>
    <LongPressGestureHandler ref={childHandlerRef}>
      // other components
    </LongPressGestureHandler>
  </View>
</LongPressGestureHandler>

You can read more about it here.

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