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

Optionally render page #1004

Closed
skizzo opened this issue Jul 1, 2019 · 10 comments
Closed

Optionally render page #1004

skizzo opened this issue Jul 1, 2019 · 10 comments

Comments

@skizzo
Copy link

skizzo commented Jul 1, 2019

Which OS ?

iOS & Android, doesn't matter.

Version

  • react-native-swiper v1.5.13 & v1.6.0@nightly.1
  • react-native v0.57.8

Expected behaviour

A page that should be optionally rendered doesn't show up at all and reduces the total amount of pages to one less than if optional page is rendered.

Actual behaviour

An empty page is shown, but the slide should be skipped completely.

Steps to reproduce

<Swiper {...swiperProps}>

  <View style={stylePage}>
    <Text>Page 1 (always)</Text>
  </View>

  <View style={stylePage}>
    <Text>Page 2 (always)</Text>
  </View>

  { renderPage3 && // if this is set to "false", an empty page is shown
    <View style={stylePage}>
      <Text>Page 3 (optional)</Text>
    </View>
  } 

  <View style={stylePage}>
    <Text>Page 4 (always)</Text>
  </View>

</Swiper>
@ArrayZoneYour
Copy link
Collaborator

Can you reproduce it on v1.6.0@nightly.1 ?

@skizzo
Copy link
Author

skizzo commented Jul 1, 2019

Yup, same thing with with v1.6.0@nightly.1.

@ArrayZoneYour ArrayZoneYour added 🔎investigate collect more info 🚧processing and removed 🔎investigate collect more info labels Jul 1, 2019
@skizzo
Copy link
Author

skizzo commented Jul 1, 2019

It makes no difference what props I put, the issue can be reproduced with the exact code I posted originally. Also, I'm sure you can imagine what an "empty page" looks like without adding a gif ;)

const stylePage = {
  flex: 1, 
  alignItems: "center", 
  justifyContent: "center", 
}

Thanks for investigating!

@ArrayZoneYour
Copy link
Collaborator

@skizzo It is a missing feature, I will try to support it in this week : )

@skizzo
Copy link
Author

skizzo commented Jul 1, 2019

You the man, thanks a lot!

ArrayZoneYour pushed a commit that referenced this issue Jul 2, 2019
@ArrayZoneYour
Copy link
Collaborator

@skizzo You can test it on react-native-swiper@1.6.0-dev.1 👀

@skizzo
Copy link
Author

skizzo commented Jul 4, 2019

Thanks, but it's still showing an empty page..

@ArrayZoneYour
Copy link
Collaborator

ArrayZoneYour commented Jul 4, 2019

🤔Have you installed the new version v1.6.0-dev.1 ?
Screen Recording 2019-07-04 at 8 15 35 PM 2019-07-04 20_17_48

@skizzo
Copy link
Author

skizzo commented Jul 8, 2019

My bad, my npm install didn't properly update the package. It works like a charm, thanks so much!

@skizzo skizzo closed this as completed Jul 8, 2019
@ArrayZoneYour
Copy link
Collaborator

The logic of updating the current index also has some problem (when the index of the page which you want to remove is less than current index ), I will fix it in next nightly version.😄

ArrayZoneYour pushed a commit that referenced this issue Jul 9, 2019
ArrayZoneYour added a commit that referenced this issue Jul 9, 2019
* feat(pages): support optionally render page

re #1004

* fix(ScrollView): android ScrollView will not scrollTo certain offset when props change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants