leecade / leecade/react-native-swiper

Adjacent pages not showing up

Open
#294 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Basically only page 0 is shown until scrolled, then page 1 and page 2 get visible.

When I first load up the page, the page 0 gets shown, it slides automatically to page 1 that is not rendered, also page 2 is not rendered. Once I tap on the Swiper and move it a bit, then all the pages get rendered. How to get them rendered correctly?

<Swiper style={styles.horizontalSwiper} index={1} width={width * 0.8}>
	<View style={styles.slide1}>
		<Text style={styles.text}>Page 0</Text>
	</View>
	<View style={styles.slide2}>
		<Text style={styles.text}>Page 1</Text>
	</View>
	<View style={styles.slide3}>
		<Text style={styles.text}>Page 2</Text>
	</View>
	<View style={styles.slide1}>
		<Text style={styles.text}>Page 3</Text>
	</View>
</Swiper>


horizontalSwiper: {
	overflow: 'visible'
},

removeClippedSubviews={false} fixes the issue, but it should not be the case when I have index={1} set up and page 1 gets never rendered.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported Swiper example with index={1}, width={width * 0.8}, overflow: 'visible', and removeClippedSubviews left at its default. Compare initial rendering with removeClippedSubviews={false}; done means pages 1 and 2 render correctly on initial load without tapping or scrolling.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.