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

175
Views
React-native Flatlist auto scroll

I have a Flat-list in react native which has items that expand & collapse (Just like dropdown), So whenever an item is clicked to expand, If the items content is overflowing in the screen.I want to scroll the item so that its content is fully visible. How can I implement that?

  • scrollToIndex won’t work in this case & for scrollToOffset how can i determine the position of the clicked item on screen?
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use measure to get the offset of the element, then use scrollToOffset

<Component ref="myComponent />
// Print component dimensions to console
this.refs.myComponent.measure( (fx, fy, width, height, px, py) => {
    console.log('Component width is: ' + width)
    console.log('Component height is: ' + height)
    console.log('X offset to frame: ' + fx)
    console.log('Y offset to frame: ' + fy)
    console.log('X offset to page: ' + px)
    console.log('Y offset to page: ' + py)
})
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!