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

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

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 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!