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

Swap Positions on Drop #61

Open
jonnyreeves opened this issue Sep 4, 2021 · 3 comments
Open

Swap Positions on Drop #61

jonnyreeves opened this issue Sep 4, 2021 · 3 comments

Comments

@jonnyreeves
Copy link

Hi There,

Thank you for providing this library and sorry for asking a question which may be a feature request.

I need the ability to swap two items positions without affecting the positions of other items in the grid. Does the library currently support this, or would this be new functionality?

Thank you.

@SHISME
Copy link
Owner

SHISME commented Sep 5, 2021

You can set disabledReSorted of the item

may like this

this.state = {
      data:[
        {name:'1',key:'one'},
        {name:'2',key:'two'},
        {name:'3',key:'three',disabledReSorted:true},
        {name:'4',key:'four',disabledReSorted:true}
      ],
    };

@jonnyreeves
Copy link
Author

jonnyreeves commented Sep 9, 2021

Hi @SHISME, thanks for coming back to me so quickly.

Using the disabledReSorted property does not meet my use-case, I need the ability to allow any grid item to be dragged to any position on the grid, however the other grid items should not move/re-order themselves, instead only the "drop target" should switch places with the item being dragged. I've hacked up a video to demonstrate this behavior.

swap-places.mp4

Do you have any suggestions as to how I could implement this behavior? Thank you.

@SHISME
Copy link
Owner

SHISME commented Sep 9, 2021

Hi @SHISME, thanks for coming back to me so quickly.

Using the disabledReSorted property does not meet my use-case, I need the ability to allow any grid item to be dragged to any position on the grid, however the other grid items should not move/re-order themselves, instead only the "drop target" should switch places with the item being dragged. I've hacked up a video to demonstrate this behavior.

swap-places.mp4
Do you have any suggestions as to how I could implement this behavior? Thank you.

https://github.com/ollija/react-native-sortable-grid i think this repository may help you

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

2 participants