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

fixed RangeError: Maximum call stack size exceeded. #1019

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

serebrennikovalex
Copy link
Contributor

Fixed RangeError: Maximum call stack size exceeded when dragging an element over a static element causes.

The point of the solution is that when we drag an element over a static one, a collision occurs and we have to interrupt the operation.

Fixes #941

@serebrennikovalex serebrennikovalex changed the title fixed RangeError: Maximum call stack size exceeded. WIP: fixed RangeError: Maximum call stack size exceeded. Oct 1, 2019
@serebrennikovalex serebrennikovalex changed the title WIP: fixed RangeError: Maximum call stack size exceeded. fixed RangeError: Maximum call stack size exceeded. Oct 1, 2019
lib/utils.js Outdated
@@ -458,7 +456,12 @@ export function moveElementAwayFromCollision(
const compactH = compactType === "horizontal";
// Compact vertically if not set to horizontal
const compactV = compactType !== "horizontal";
const preventCollision = false; // we're already colliding
let preventCollision = false; // we're already colliding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can be done a little bit simpler:

const preventCollision = collidesWith.static

and, I think, we should change this comment we're already colliding -> we're already colliding (not for static items) and remove comment when preventCollision = false and element is static then we have RangeError: Maximum call stack size exceeded, it's better to place this comment into the commit message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, thank you.

@daynin daynin requested review from n1ghtmare and STRML October 4, 2019 11:16
@STRML STRML merged commit ddebb65 into react-grid-layout:master Oct 7, 2019
@STRML
Copy link
Collaborator

STRML commented Oct 7, 2019

Thanks for the contribution!

@STRML STRML added this to the 0.17.0 milestone Oct 9, 2019
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

Successfully merging this pull request may close these issues.

Dragging an element over a static element causes RangeError: Maximum call stack size exceeded
3 participants