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: pass willRecomputeLayouts to useClientRect call for overlayNodeRect #426

Closed
wants to merge 1 commit into from

Conversation

wmain
Copy link
Contributor

@wmain wmain commented Aug 18, 2021

Thanks for the additional investigation done for #408 @clauderic. It looks like removing willRecomputeLayouts from the useClientRect call of overlayNodeRect rebreaks our case, however. Reading over the methodology/cause of the changes you made, I'm not sure why this argument was removed, but adding it back in seems to fix things. It seems to me that recomputing the layout rect of the measurable child is required as the overlay moves.

@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2021

⚠️ No Changeset found

Latest commit: 8eb2d3a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wmain
Copy link
Contributor Author

wmain commented Aug 18, 2021

Nuts, E2E tests are broken in CI and working locally again. I assume you've got some insight about what's going on here.

@clauderic
Copy link
Owner

clauderic commented Aug 18, 2021

Nuts, E2E tests are broken in CI and working locally again. I assume you've got some insight about what's going on here.

Yeah, go try this story which illustrates the problem http://localhost:6006/iframe.html?id=presets-sortable-multiple-containers--many-items&args=&viewMode=story

When we use the DragOverlay as the source of the collision rect, everything works fine when you measure it for the first time, before it's moved using transform.

Subsequent measurements are affected by the transform that is applied on the DragOverlay, such that the top, left, right and bottom properties that we get back already include the transform that we're applying, which represents the net movement of the active sensor.

To fix this, I think the easiest way would be to subtract the current transform on subsequent measurements of the DragOverlay rect.

@clauderic
Copy link
Owner

It's a rather involved fix so I'll open a separate PR

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.

2 participants