leecade / leecade/react-native-swiper

Dynamic height? Documentation claims <Swiper> adheres to `flex: 1` however...

Open
#388 2 comments 8 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

Why doesn't it act as a component with the flex property of flex: 1 that has been set? It does not play well with other components at all.

For example, here's a simple screen that's completely blue, all besides the bottom 200 points which is white.

<View style={{flex: 1}}>
  <View style={{flex: 1, backgroundColor: 'blue'}} />
 <View style={{height: 200}} />
</View>

Doing the same thing with the Swiper component yields completely different results.

<View style={{flex: 1}}>
  <Swiper> { /* flex:1 by default according to docs */ }
    <View style={{flex: 1, backgroundColor: 'blue'}} />
  </Swiper>
  <View style={{height: 200}} />
</View>

Now the entire screen is covered in blue, with the 200pts being pushed off the screen,

So how do we really make a Swiper with dynamic height?

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 two layout examples in the issue and inspect the Swiper component's default sizing behavior and documentation for its flex setting. Done means a Swiper can use dynamic height while preserving the sibling View with height: 200, with the documented behavior matching the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.