Skip to content

Fix shift to next row calculation #691

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

Merged
merged 1 commit into from
Mar 19, 2021
Merged

Conversation

alexcheuk
Copy link
Contributor

@alexcheuk alexcheuk commented Apr 29, 2020

This PR fixes the issue that is happening in this demo (http://clauderic.github.io/react-sortable-hoc/#/basic-configuration/grid?_k=8abqva)

and demonstrated in this issue #626
image

The calculation that was made to determine if a node has moved past the right bounds is using offset.width which is only half of the width of the node. This means, if there are more than half of the width of empty space on the right of the container, the node will shift out of the Grid like the image above.

resolves #626, resolves #551, resolves #523, resolves #689

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit eb9a56c:

Sandbox Source
mystifying-sunset-r00bw Configuration

@23chrischen
Copy link

+1 I'd love to see this merged, this is causing me some headache

@alexcheuk
Copy link
Contributor Author

+1 I'd love to see this merged, this is causing me some headache

I temporarily published the fix at @alexcheuk/react-sortable-hoc if anyone wants to test if it fixes their issues.

@clauderic clauderic merged commit f77d193 into clauderic:master Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants