Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultIndex does not work as expected #33

Closed
schiller-manuel opened this issue Nov 12, 2021 · 4 comments
Closed

defaultIndex does not work as expected #33

schiller-manuel opened this issue Nov 12, 2021 · 4 comments
Assignees

Comments

@schiller-manuel
Copy link

The defaultIndex prop does not work as expected, for the following example it results in:

  • defaultIndex=0, index 0 shown
  • defaultIndex=1, index 6 shown
  • defaultIndex=2, index 5 shown
  • defaultIndex=3, index 4 shown
  • defaultIndex=4, index 3 shown
  • defaultIndex=5, index 2 shown
  • defaultIndex=6, index 1 shown
export default function App() {
  return (
    <View
      style={{
        flex: 1,
        backgroundColor: 'black',
      }}>
      <View style={{height: 300}}>
        <Carousel
          loop={true}
          width={width}
          data={data}
          defaultIndex={0}
          renderItem={({color}, index) => {
            return (
              <View
                style={{
                  backgroundColor: color,
                  flex: 1,
                }}>
                <View
                  style={{
                    flex: 1,
                    backgroundColor: color,
                    justifyContent: 'center',
                    alignItems: 'center',
                  }}>
                  <Text style={{fontSize: 80}}>{index}</Text>
                </View>
              </View>
            );
          }}
        />
      </View>
    </View>
  );
}
defaultIndex.mp4
@dohooo
Copy link
Owner

dohooo commented Nov 13, 2021

I think I know what happened, I will fix it as soon as possible.

@dohooo
Copy link
Owner

dohooo commented Nov 16, 2021

I am sorry that I have been busy recently. I am still paying attention to the problem and I will fix it as soon as possible, maybe this week.

@dohooo dohooo self-assigned this Nov 19, 2021
@dohooo dohooo added this to In progress in Tasks dashboard. Nov 20, 2021
@dohooo dohooo moved this from In progress to In test in Tasks dashboard. Nov 20, 2021
@gxxgcn gxxgcn closed this as completed Nov 20, 2021
@gxxgcn gxxgcn reopened this Nov 20, 2021
@gxxgcn gxxgcn moved this from In test to Done in Tasks dashboard. Nov 20, 2021
@gxxgcn gxxgcn moved this from Done to In test in Tasks dashboard. Nov 20, 2021
@gxxgcn gxxgcn closed this as completed in c67206f Nov 20, 2021
Tasks dashboard. automation moved this from In test to Done Nov 20, 2021
@dohooo
Copy link
Owner

dohooo commented Nov 20, 2021

v1.0.5

THX! 🍺!!~

@schiller-manuel
Copy link
Author

Thanks, just tested it, it works!

dohooo added a commit that referenced this issue Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants