Comments (27)
@delvedor Thank you for letting me know. Do not hesitate to ping me if the issue comes back ;)
from react-native-snap-carousel.
@alialaa Hi! Could you tell me which version of the plugin you're currently using? Also, can you try to set enableMomentum
to false
and see if that improves the behavior?
from react-native-snap-carousel.
@bd-arc Hey, I am using 2.0.3 and I think enableMomentum is false by default, I tried setting it to true it got even worse that it won't even change the slide at all.
from react-native-snap-carousel.
@alialaa I must admit that we didn't create this plugin with small slides in mind, which means we might need to adjust a few things for this use case. I will take a look at it shortly and keep you posted.
from react-native-snap-carousel.
@bd-arc thanks a lot, please update me even if it can't be done so that I can find another solution.
from react-native-snap-carousel.
@alialaa Hi! I've just published a new version (2.1.0
) that exposes a previously private property: activeSlideOffset
.
Setting a smaller value than the default 25
should resolve your issue. Can you please confirm?
from react-native-snap-carousel.
@bd-arc Hey, this was useful but I don't think it's what was causing my issue, I am posting you an actual video to illustrate the issue a bit more accurately. as you can see the slide is set to active when it has a 100% opacity but when I release my hand some weird bouncing animation happens.
snaptest.mp4.zip
from react-native-snap-carousel.
@alialaa Thanks for the video; it helps clarifying the issue.
If this is not too much trouble, could you create a basic React Native project with your picker? Nothing fancy, just the carousel implementation and your styles. I would then use this as a starting point to investigate further.
from react-native-snap-carousel.
@bd-arc Ok I'll do it next week, thanks a lot.
from react-native-snap-carousel.
Hello, same issue here!
- React Native version:
v0.42.0
- react-native-snap-carousel:
v2.1.0
The size of a slide is:
- 200 width
- 100 height
- 15 margin horizontal
- 5 margin vertical
As above, enableMomentum
didn't solve the problem and activeSlideOffset
either.
from react-native-snap-carousel.
@bd-arc @delvedor When I created a project from scratch surprisingly the carousel worked just fine, so probably it's something in my other project. I will let you know if I figured it out. Thanks for your time.
from react-native-snap-carousel.
@alialaa can you past the code you used in the new projetc?
This is mine:
const slides = elements.map((entry, index) => {
return (
<View key={index} style={{
backgroundColor: colors.white,
height: 100,
width: 200,
marginHorizontal: 15,
marginVertical: 5,
padding: 10,
borderRadius: 5,
shadowColor: '#000',
shadowOffset: {
width: 2,
height: 3
},
shadowOpacity: 0.2
}}>
<ProximaText>{entry.title}</ProximaText>
<ProximaText>{entry.location.name}</ProximaText>
<ProximaText>{entry.time}</ProximaText>
</View>
)
})
return (
<Carousel
sliderWidth={windowWidth}
itemWidth={230}
inactiveSlideScale={1}
showsHorizontalScrollIndicator={false}
removeClippedSubviews={false}
containerCustomStyle={{
position: 'absolute',
bottom: 20
}}
>
{slides}
</Carousel>
)
}
from react-native-snap-carousel.
from react-native-snap-carousel.
Thanks!
I found that if I wrap the Carousel in this way:
<View style={{ flex: 1, alignItems: 'center' }}>
<Carousel />
</View>
The problem disappear (but in my case disappear the Map component as well :P)
Edit:
I found that the bug appears when I add the react-native-maps component:
<View style={{ flex: 1 }}>
<Map />
<Carousel />
</View>
@bd-arc any idea? :)
related: #11
from react-native-snap-carousel.
@alialaa Thanks for letting me know ;)
@delvedor I assume that you're trying to recreate something along the lines of our map implementation, aren't you? :) There might be a touch handling conflict between the two components. One thing you should know is that our Carousel
component is wrapped in a Modal
component. Could you try to do the same and see if that helps with the issue? Then we can take a closer look at Modal
's specifics and see if we can improve our plugin.
from react-native-snap-carousel.
Oh, I see!
Just to understand better, you have something like this?
<View style={{ flex: 1 }}>
<Map />
<Modal position='bottom' isOpen>
<Carousel />
</Modal>
</View>
from react-native-snap-carousel.
@delvedor Absolutely.
from react-native-snap-carousel.
Perfect, now I give it a try and I let you know, thanks!
from react-native-snap-carousel.
Nope, same issue :S
render () {
return (
<View style={{ flex: 1 }}>
{this.renderMapOrSpinner()}
<Modal
position='bottom'
isOpen
backdrop={false}
swipeToClose={false}
style={{
backgroundColor: 'rgba(0,0,0,0)',
height: 130
}}
>
{this.renderCarousel()}
</Modal>
</View>
)
}
If I remove the map element, the carousel works perfectly.
Edit:
Are you using https://github.com/airbnb/react-native-maps ?
from react-native-snap-carousel.
@delvedor Yes, we're using the AirBnb plugin. It's broken in many ways, but there are no real alternatives at the moment :(
Could you try with the backdrop
prop enabled?
from react-native-snap-carousel.
@bd-arc I know :S
By the way, nothing changed with backdrop
prop enabled.
from react-native-snap-carousel.
@delvedor Then I'm currently out of ideas :-)
Could you create a simple React Native project that would allow me to reproduce the issue and investigate?
from react-native-snap-carousel.
At the moment I cannot create it, if you want we can talk in private (mail?).
In this way I can tell you a little bit of my configuration and if we solve the issue we can update here :)
from react-native-snap-carousel.
@delvedor Let's do that. You can reach me at [email protected]. Make sure to include everything that could help me reproduce the issue. A zip file of your project including only the relevant components (stripped from any sensitive data) would clearly come in handy ;-)
from react-native-snap-carousel.
@delvedor Hi! Unless I'm mistaken, I haven't heard from you yet. Are you still facing the issue?
from react-native-snap-carousel.
Closing as no further feedback was provided.
from react-native-snap-carousel.
Hi!
Sorry for the delay, but in this period I'm working a lot! :P
I've tried my app on a physical device and this "choppy" behaviour It's disappeared, while there is still in the simulator, so probably is something related to the simulator itself.
If something changes I let you know, thank you for your help and patience.
from react-native-snap-carousel.
Related Issues (20)
- how to detect slide animation end??
- snap carousel
- ViewPropTypes will be removed from React native HOT 1
- Fix ViewPropTypes usage for deprecated prop types HOT 2
- h
- This causes issues when switching to RTL in Android
- App crashes on android 12 devices due to useNativeDriver true on slide animations
- React Native Snap Carousel ViewPropTypes warning resolved
- ViewPropTypes will be removed from React Native error
- why this carousel not give me onScroll native events. like flatlist i want to move 2 carousel at the same time on the base of reference. i can handle it by onSnapToIndex and onScrollEnd but i want to handle onScrollBeing .
- Align carousel items to the left. HOT 1
- accessing touch gesture handler or control from carousel component
- error while updating property 'transform' of a view managed by rctview
- ViewPropTypes is deprecated HOT 6
- custom carousel with centered image and 2 images in each side
- ViewPropTypes needs to be exported from 'deprecated-react-native-prop-types' package instead 'react-native' HOT 4
- sub Element cannot response click event when scrollView is scrolling. HOT 1
- Dynamic Height Content in Carousel
- when i set startAutoplay to true, it cannot auto play, i do not know wht
- white space is coming if I disabled the infinite scroll HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-snap-carousel.