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

Add react-draggable? #35

Closed
kimborgen opened this issue Oct 29, 2018 · 4 comments
Closed

Add react-draggable? #35

kimborgen opened this issue Oct 29, 2018 · 4 comments

Comments

@kimborgen
Copy link
Contributor

kimborgen commented Oct 29, 2018

Hi!

First off, loving your project.

As mobile support is a must these days it is sad that this project does not support it. I would like to have one component for one "feature" if you know what i mean.

I've been able to include react-draggable and react-scroll-horizontal in my own project. And it seems to work pretty good! But it was not as easy as I would like.

Is integrating react-draggable in this project a feature you would like? @hew
And something that I should try solving?

Alternativly we can just add a detailed entry in the readme on how to integrate the two projects.

Previous work

I saw that in #4 you allready tried this approch, any luck there? @zachgibson seems to have made progress on this (#4 & #28), but has not submitted a PR.

General Approch:

  1. When dragging you get a delta x from draggable. (But no dragging / moving is happening because we disable that)
  2. This delta x is passed down to the HorizontalScroll component on the new prop animValues (See PR Add animValues prop #36 )
  3. The horizontal scroll component then does it's thing as if a scroll had just happend by updating the state variable animValues with the new prop and then calculating new motion.
  4. Profit.
@JonathanWi
Copy link

Interested as well, any chance you could share your implementation somewhere and/or create a PR with it?

@kimborgen
Copy link
Contributor Author

@JonathanWi

Hi, I did not want to start working on a feature before it was confirmed that this was something the project maintainer wanted. So i have not made any PR yet.

In order to implement react-draggable this project needs to merge #36. Since this is not done yet (The project maintainer seems inactive) you can pull this from my project: https://github.com/kimborgen/react-scroll-horizontal

In order to add this project with npm you can either do something with npm link (google it, I don't remember how i did it) or take a look at this: https://stackoverflow.com/questions/33181297/npm-install-from-github-pull-request

And in order to add react-draggable, you can look at my personal project here: https://github.com/kimborgen/kimborgen.com/blob/master/src/components/instafeed/InstaFeed.jsx

@hew
Copy link
Owner

hew commented Dec 5, 2018

Hey everyone. Sorry for the late response.

Is integrating react-draggable in this project a feature you would like?

I don't think so. I'd rather just leave the animProp from your PR open (nice work on that btw) so that the scroll can be solved in user space. But I'd 100% be for a note in the PR that shows how to integrate react-draggable.

@hew hew closed this as completed Dec 5, 2018
@hew
Copy link
Owner

hew commented Dec 5, 2018

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

No branches or pull requests

3 participants