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

Feature Request: Drag and drop in a Grid #4

Closed
oyeanuj opened this issue Jun 10, 2016 · 14 comments
Closed

Feature Request: Drag and drop in a Grid #4

oyeanuj opened this issue Jun 10, 2016 · 14 comments

Comments

@oyeanuj
Copy link

oyeanuj commented Jun 10, 2016

Hi @clauderic! I thought I'll create a standing issue incase anyone else is interested in working on this or has thoughts as well.

The feature request: Be able to drag and drop across axis, i.e., in a grid of any sort. Currently, the library only works one axis at a time.

Based on conversations with @clauderic, I looked into the issue a little bit more and it seems like the changes are only limited to SortableContainer and that too, mostly around calculating offset and managing the translate3d function. I am still trying to familiarize myself with how they really work.

I also imagine we'll need to also add a new prop or modify 'axis' prop to reflect the three choices - x, y or xy.

@clauderic
Copy link
Owner

clauderic commented Jun 10, 2016

Yeah, the axis prop would need to become an array/config object, but that's a fairly small change. The tricky part will really be the animations and translate3d calculations I think. I'll look into this as soon as I get the chance

@jarrydfillmore
Copy link

+1!

1 similar comment
@SimonSelg
Copy link

+1!

@tobiashieb
Copy link

+1!

@zaklampert
Copy link

+1

2 similar comments
@hervejegou
Copy link

+1

@alexedev
Copy link

alexedev commented Oct 4, 2016

+1

@oshalygin
Copy link

+1. I'll do some research in the coming weeks and look into a solution. Need to familiarize myself with the library source code a bit and then take a stab. If anyone started any work on this, would be good to hop in and not waste any dev time

@richmeij
Copy link
Collaborator

richmeij commented Nov 4, 2016

Hi all, just stumbled upon this issue. I currently use a modified version of this lib that works in a grid. I can probably whip up a PR somewhere next week.

@richmeij richmeij mentioned this issue Nov 12, 2016
clauderic pushed a commit that referenced this issue Nov 27, 2016
Feature: Grid support (addresses #4)
@clauderic
Copy link
Owner

Great news, 0.3.0 was just released, with support for sorting items in a grid! Currently, support is limited to items of equal width and height, though adding support for variable widths is definitely on the roadmap.

Huge shout-out to @richmeij for all his efforts to make this happen ❤️

@jaspersorrio
Copy link

jaspersorrio commented Dec 22, 2016

Hi all, I cant seem to get the grid to work.

I wasn't sure if i was adding axis="xy" at the wrong element or what, so i added to every element haha.

https://jsfiddle.net/usth13z9/

@richmeij
Copy link
Collaborator

Hi @jaspersorrio, you only need the axis prop on the SortableContainer. All that remains is then displaying the items in a grid. See here: https://jsfiddle.net/9j3khf25/1/

@jaspersorrio
Copy link

Awesome! Thanks @richmeij !

Also was wondering if the source code to https://clauderic.github.io/react-sortable-hoc is availabe? If so where can we find them?

@clauderic
Copy link
Owner

@jaspersorrio most examples are available locally by running npm run storybook, and you can find the source code for them here: https://github.com/clauderic/react-sortable-hoc/blob/master/src/.stories/index.js

There's also an examples folder you can take a look at: https://github.com/clauderic/react-sortable-hoc/tree/master/examples

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