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

fix: Modify Drag values according to containerPadding #1323

Merged
merged 4 commits into from Nov 24, 2023

Conversation

hywlss9
Copy link
Contributor

@hywlss9 hywlss9 commented Oct 30, 2020

If you drag the item with containerPadding, it looks as if it is moved more than the actual location.

@github-actions github-actions bot added infrastructure deps use this label for changes in the project's dependencies labels Oct 30, 2020
@github-actions
Copy link

github-actions bot commented Jan 5, 2021

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days

@github-actions github-actions bot added the stale The label to apply when a pull request or an issue is stale label Jan 5, 2021
@STRML STRML removed the stale The label to apply when a pull request or an issue is stale label May 21, 2021
@STRML
Copy link
Collaborator

STRML commented May 21, 2021

Can't merge with all these project changes - please remove the changes to dist, .gitignore, build, etc., then we can review it.

@github-actions
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days

@github-actions github-actions bot added the stale The label to apply when a pull request or an issue is stale label Aug 20, 2021
@hywlss9
Copy link
Contributor Author

hywlss9 commented Mar 21, 2023

I deleted dist, .gitignore, build, etc. I'm sorry I'm late.
@STRML

@mvrozanti
Copy link

mvrozanti commented Oct 13, 2023

@STRML hi

is there anything holding back this PR? I stumbled upon this issue, I noticed the same problem.

@STRML
Copy link
Collaborator

STRML commented Nov 24, 2023

Wow, this is actually a big fix - if containerPadding is at all significant, the calculations were really wrong.

I kind of regret this even being an option. It would be better if one used an outer container with padding or had margin on the grid layout. But here we are, and thank you for the fix!

@STRML STRML merged commit fee5f13 into react-grid-layout:master Nov 24, 2023
@STRML
Copy link
Collaborator

STRML commented Nov 24, 2023

1.4.4

@mvrozanti
Copy link

mvrozanti commented Nov 24, 2023

Nice! Thank you!

@hywlss9
Copy link
Contributor Author

hywlss9 commented Nov 24, 2023

Thank you!
Hope you enjoy using this :)

jay0815 added a commit to jay0815/react-grid-layout that referenced this pull request Feb 5, 2024
The logic for calculating the positions of top and left in PR react-grid-layout#1323 is problematic. The compensation calculation for the containerPadding attribute should be placed in calcXY instead of being processed every time during dragging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps use this label for changes in the project's dependencies infrastructure stale The label to apply when a pull request or an issue is stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants