kkemple / kkemple/react-native-sideswipe

changing orientation causes items to be misaligned

Open
#77 0 comments 0 reactions 0 assignees View on GitHub
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:

![image](https://user-images.githubusercontent.com/6631654/102025056-18a95180-3d5b-11eb-8dcf-6b25ce0f62a7.png)

Immediately after switching to landscape:

![image](https://user-images.githubusercontent.com/6631654/102025059-2232b980-3d5b-11eb-9fd4-dcdbc11fbb95.png)

After swiping around in landscape:

![image](https://user-images.githubusercontent.com/6631654/102025107-53ab8500-3d5b-11eb-9345-693c9a70e786.png)

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.