meliorence / meliorence/react-native-image-gallery
Android Breaks When initialPage Index > 10
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 717
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Description
Related to issue #9
Affected version: v2.1.5
Affects Android Only
Work around: downgraded to v2.1.4
Issue Summary
With v2.1.5 installed, tapping any thumbnail greater than 10 causes unexpected behavior ranging from the wrong image being displayed to loss of swipe and pinch-to-zoom functionality.
Issue Details
- When tapping thumbnails on a Flatlist Grid when
index <= 10, everything works as expected. The correct image appears full screen in the gallery, pinch-to-zoom works, swiping works. All is good. - When
index === 11, the 10th image flashes but the 11th is eventually shown. Both pinch-to-zoom and swiping work as expected. - When
index ===12, the 10th image flashes, 11th image is shown. Both pinch-to-zoom and slider sometimes work, sometimes not. It's inconsistent. When working, the 12th image immediately appears on swipe initiation (without animation). - When
index >=13, the 10th image flashes, 11th image is shown. Neither pinch-to-zoom nor slider work (ever!).
Here's a video demonstrating the issue...
http://recordit.co/pSRuvmcX04
More Info which may or may not be helpful
While troubleshooting this, I verified that the offsetX calculation is correct in react-native-image-gallery#225
- Docs: FlatList.scrollToOffset()
- Docs: VirtualizedList.scrollToOffset()
- I found this issue in another app as well. Download "Kitten Tricks". Then go to Social > User Profile V1 (2 or 3 work as well) > then under the thumbnails, tapping on any thumbnail
thumbnailIndex <= 10results in the correct image being enlarged.thumbnailIndex > 10results in the 10th image being enlarged.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/libraries/ViewPager/index.js, including the offsetX calculation referenced near line 225, and reproduce the Android behavior from a FlatList grid using thumbnail indices 10, 11, 12, and 13 or higher. Compare the behavior between v2.1.4 and v2.1.5; done means every thumbnail opens the correct image with reliable swiping and pinch-to-zoom.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100