Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the plugin compatible with react-native-web? #389

Open
5 tasks done
geminiyellow opened this issue Sep 4, 2018 · 16 comments
Open
5 tasks done

Make the plugin compatible with react-native-web? #389

geminiyellow opened this issue Sep 4, 2018 · 16 comments

Comments

@geminiyellow
Copy link

Is this a bug report, a feature request, or a question?

A QUESTION

Have you followed the required steps before opening a bug report?

(Check the step you've followed - replace the space character between the square brackets ([]) by an x.)

Have you made sure that it wasn't a React Native bug?

yep, on ios it is very good.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

not test on Android. i want to use this lib on web app.

Is the bug reproductible in a production environment (not a debug one)?

yep, just copy the example to a react-native-web project, you can create a new one by https://github.com/VISI-ONE/create-react-native-web-app

Environment

Environment:
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-web": "0.8.4",
"react-native-snap-carousel": "^3.7.2",

Target Platform:
Chrome (68.0.3440.106)

Expected Behavior

onSnapToItem not working, so it cannot loop

Actual Behavior

(Write what happened. Add screencasts/screenshots!)

Reproducible Demo

(Paste the link to a Snack example in which the issue can be reproduced. Please follow the guidelines for providing a Minimal, Complete, and Verifiable example.)

navigator

Steps to Reproduce

(Write your steps so that anyone can reproduce the issue in the Snack demo you provided.)

@bd-arc bd-arc changed the title onSnapToItem not working in react-native-web project Make the plugin compatible with react-native-web? Sep 6, 2018
@bd-arc
Copy link
Contributor

bd-arc commented Sep 6, 2018

Hi @geminiyellow,

The plugin has never been designed to be used with react-native-web.

I'm pretty sure that a lot of work is required to make it play well. I've got too much on my plate at the moment, but if someone is willing to take a stab at it, a PR is most welcome :-)

@bd-arc
Copy link
Contributor

bd-arc commented Sep 21, 2018

For those who want to work on this feature, leveraging the CSS scroll-snap property seems like the simplest and best way to make the carousel compatible with recent browsers.

For more info, start here: https://developers.google.com/web/updates/2018/07/css-scroll-snap

@srameshr
Copy link

Anybody picking this up?

@geminiyellow
Copy link
Author

opps, maybe nobody

@geminiyellow
Copy link
Author

@srameshr 1 month later, i check the code again, and i found that react-native-web not support the scroll props. here -> fix(ScrollView): support scroll props #1091

so, this package cannot exec onSnap and this issue come.
am i right ?

and @bd-arc can you give some more detail about the lifecycle about the state change ?
i not really understand it so cannot do anything about it.

@srameshr
Copy link

srameshr commented Dec 4, 2018

I am currently using full-screen slides, so I don't need the support for snap function.
I am using this plugin by transpiling and it works on web.

@geminiyellow
Copy link
Author

@srameshr why? i don't think so, when you release at half slider, it will not auto snap to item, that is not right behavior for this package. but, could you give some code about you how to use it on web?

@srameshr
Copy link

srameshr commented Dec 4, 2018

Just npm install it and import. I use it with react-native-web

@geminiyellow
Copy link
Author

@srameshr ok, got it, so, i should wait react-native-web fix this or give up .

@kristerkari
Copy link

kristerkari commented Dec 24, 2018

I contributed some code to react-native-web that might make it a bit easier to make this library compatible with Web.

The first one is a fix to ScrollView's smooth scrolling, fixing a bug and making it possible to polyfill smooth scrolling for browsers that do not support it:
necolas/react-native-web@30d7c31

The second one is to add support for for ScrollView's pagingEnabled property using CSS Scroll Snap. Looking at the code it seems to me that this library is not using the pagingEnabled prop, but it is possible to do a similar code change inside this library:
necolas/react-native-web@1e202b6

As already mentioned in this thread, the big missing feature is the support for the scroll end events of ScrollView. There is however an idea of how to implement it:
necolas/react-native-web#1021 (comment)

@pnkapadia6
Copy link

Hey @kristerkari, have you found a library which we could possibly use with react-native-web for carousels? Or we have to wait for the support as mentioned in the issues you tagged?

@kristerkari
Copy link

Or we have to wait for the support as mentioned in the issues you tagged?

Yeah, the scroll events for ScrollView are still not supported. I'm not sure what the situation is for FlatList.

@kopax
Copy link

kopax commented Mar 31, 2020

Hi, I found this by googling react native carousel on google, I read the doc, I was in love, I saw it doesn't work on web, I had to abandon. Does anybody know a lib I could use for ios/native and web? I need a simple horizontal carousel.

Thanks a lot for sharing this.

@elan
Copy link

elan commented Aug 12, 2020

If you just set pagingEnabled on <Carousel> that works.

@RoshanRoyal
Copy link

is this plugin going to support react-native-web?

@justindi15
Copy link

@kopax found this and it seems to be working for me https://www.npmjs.com/package/react-native-web-swiper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants