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 zoomed out mode drag chip position when dragging over the scaled iframe #56889

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Dec 8, 2023

What?

The dragOver event returns some unusual values for clientX and clientY when dragging over a scaled iframe. This results in the drag chip being incorrectly positioned when dragging into the canvas in zoomed out mode.

This PR normalizes those values to ensure the drag chip stays in the correct position.

How?

Testing Instructions

  1. Enable the zoomed out mode experiment
  2. In the site editor, edit a template
  3. Open the global inserter
  4. Drag a block in zoomed out mode

In trunk: The drag chip has the wrong position
In this PR: The drag chip has the wrong position

Screenshots or screencast

Before

Kapture.2023-12-08.at.10.34.41.mp4

After

Kapture.2023-12-08.at.10.32.38.mp4

@talldan talldan added [Type] Bug An existing feature does not function as intended [Feature] Drag and Drop Drag and drop functionality when working with blocks labels Dec 8, 2023
@talldan talldan self-assigned this Dec 8, 2023
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for the explanatory comments, they really helped 🙇

Before After
Screen.Recording.2023-12-08.at.2.42.05.pm.mp4
Screen.Recording.2023-12-08.at.2.50.20.pm.mp4

@aaronrobertshaw aaronrobertshaw merged commit 55e84f0 into try/zoomed-out-mode-experiments Dec 8, 2023
56 of 58 checks passed
@aaronrobertshaw aaronrobertshaw deleted the fix/zoomed-out-mode-drag-chip-position branch December 8, 2023 02:58
@draganescu draganescu mentioned this pull request Mar 6, 2024
42 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants