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 drag-and-drop when dragging outside components #3177

Merged
merged 5 commits into from
Feb 8, 2024

Conversation

apedroferreira
Copy link
Member

@apedroferreira apedroferreira commented Feb 7, 2024

I've noticed recently that the drag-and-drop is buggy in some cases, it can probably be quite annoying and turn off some users... Added a fix and a test.
Not sure what changed to cause this problem, it seems like the page boxes used to include the margins but now they don't.

Before:

Screen.Recording.2024-02-07.at.18.03.13.mov

After:

Screen.Recording.2024-02-07.at.18.03.48.mov

I've seen some bad bugs with renaming nodes/pages too, will take a look at those next and create an issue if it's not quick.

@apedroferreira apedroferreira self-assigned this Feb 7, 2024
@Janpot
Copy link
Member

Janpot commented Feb 7, 2024

maybe a test?

@@ -112,20 +114,58 @@ test('showing drag-and-drop previews', async ({ page, argosScreenshot }) => {
await argosScreenshot('drop-preview-left', screenshotConfig);

await page.mouse.move(...getDropPreviewTopCoordinates(inputBoundingBox!), {
steps: 10,
steps: 1,
Copy link
Member Author

Choose a reason for hiding this comment

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

10 steps was misleading, it wasn't really screenshotting the final state after the drag.

@apedroferreira
Copy link
Member Author

maybe a test?

Yep I was gonna add it, added it now.

@apedroferreira apedroferreira changed the title Fix drag and drop Fix drag-and-drop when dragging outside components Feb 7, 2024
@apedroferreira apedroferreira marked this pull request as ready for review February 7, 2024 20:01
Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

I suppose these screenshot changes are expected?

@apedroferreira
Copy link
Member Author

I suppose these screenshot changes are expected?

Nope they were wrong, these step numbers seem to influence certain screenshots... I fixed it now.

@apedroferreira apedroferreira merged commit 730939f into mui:master Feb 8, 2024
11 checks passed
@apedroferreira apedroferreira deleted the fix-drag-and-drop branch February 8, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work feature: App Editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants