kkemple / kkemple/react-native-sideswipe

Carousel locks onto index 0 even when current index is non-zero

Open
#39 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
900
Forks
69
PR merge metrics
No merged PRs in 30d

Description

I have a sideswipe view that contains a data array that the user can add and remove items to. However, when I try sliding the view to another item in the array, the carousel locks itself to the item with index 0, even though the container's currentIndex state and the matching prop on the items themselves are some other index.

`envinfo` results:
System:
OS: Linux 4.4 Ubuntu 16.04.3 LTS (Xenial Xerus)
CPU: x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 5.82 GB / 15.89 GB
Shell: 4.3.48 - /bin/bash
Binaries:
Node: 8.9.1 - /usr/bin/node
npm: 6.2.0 - /usr/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
Utilities:
Make: 4.1 - /usr/bin/make
GCC: 5.4.0 - /usr/bin/gcc
Git: 2.7.4 - /usr/bin/git
IDEs:
Nano: 2.5.3 - /bin/nano
Vim: 7.4 - /usr/bin/vim
Languages:
Bash: 4.3.48 - /bin/bash
Java: 1.8.0 - /usr/bin/javac
Perl: 5.22.1 - /usr/bin/perl
Python: 2.7.12 - /usr/bin/python
Ruby: 2.2.7 - /usr/share/rvm/rubies/ruby-2.2.7/bin/ruby
Databases:
SQLite: 3.11.0 - /usr/bin/sqlite3
Browsers:
Chrome: 62.0.3202.94

Please make sure these boxes are checked before submitting your issue!

- [ X ] envinfo results
- [ X ] I created a reproduction example [here](https://snack.expo.io/rk_-J_9Q7) (if bug related)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the linked Expo Snack reproduction and inspect the carousel's handling of currentIndex while items are added or removed. Compare the container state and item props during a swipe, then verify that the carousel stays on the requested non-zero index instead of returning to index 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.