kkemple / kkemple/react-native-sideswipe
changing orientation causes items to be misaligned
- Dominant language
- JavaScript
- Stars
- 900
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
If I change orientations while a SideSwipe instance is rendered, the items will initially be misaligned, see screenshot below. If I swipe around a bit the carousel item will lock back into its proper place and work fine from that point on. The problem seems to only exist immediately after the orientation change. No idea if this is a bug or if there's something I can add to get around it, but any help would be very much appreciated!
Code:
```
setIx(ix)}
renderItem={({item: image, itemIndex}) => {
return (
)
}}
/>
```
Example:
Initially loaded with portrait orientation:

Immediately after switching to landscape:

After swiping around in landscape:

Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue using the provided SideSwipe example, changing from portrait to landscape while the instance is rendered and checking the item alignment before swiping. Trace the SideSwipe component entry point and verify that carousel items are correctly aligned immediately after orientation changes, without requiring additional swipes.
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