Middle click + drag and moving fast with the mouse miscalculates canvas scroll position

Created on 5 August 2024, about 1 month ago
Updated 12 September 2024, 4 days ago

Problem

The canvas scroll position gets miscalculated when you start panning by middle clicking with a mouse on the iframe/preview, then you move your mouse fast and cross the boundary of the iframe/preview and the canvas.

Steps to reproduce

  1. Start panning by middle clicking with a mouse inside the iframe/preview close to its edge;
  2. Move your mouse fast so that the cursor crosses the boundary of the iframe/preview and the canvas;
  3. Notice that the entire canvas gets mispositioned.

Proposed resolution

Idea by @jessebaker:

I wonder if there is a way to make handleCanvasMouseMove and handlePreviewMouseMove both accept the same input and not need the x/y delta to be passed in to handlePreviewMouseMove. I suspect the issue is that issue might be caused by the difference in how we calculate the translation if the mouseMove stops being on the iframe and starts being on the parent.

🐛 Bug report
Status

Needs review

Component

Page builder

Created by

🇭🇺Hungary balintk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024