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.

Screen recording of the problem

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.

CommentFileSizeAuthor
xb-middle-click+drag-fast.gif778.07 KBbalintbrews
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

Issue summary: View changes
gauravvvv’s picture

Assigned: Unassigned » gauravvvv

gauravvvv’s picture

Assigned: gauravvvv » Unassigned
jessebaker’s picture

This is failing the Cypress tests but I did checkout the branch and have a try. In its current state if you middle click on the iframe it now immediately jumps the view to the top left of the canvas which is worse than before so I have marked the MR as a draft.

fazilitehreem’s picture

Assigned: Unassigned » fazilitehreem

fazilitehreem’s picture

Raised new MR for middle click +drag issue

fazilitehreem’s picture

Assigned: fazilitehreem » Unassigned
Status: Active » Needs review

fazilitehreem changed the visibility of the branch 3466063-Middle-click to hidden.

wim leers’s picture

Assigned: Unassigned » jessebaker

Requesting review from @jessebaker since he previously reviewed this in #6.

jessebaker’s picture

Assigned: jessebaker » balintbrews

@balintbrews I'm sorry I didn't get to this before my time off! I think the best course of action here is to merge what has been done because it is a big improvement and then open a follow up ticket to further address the issue (now instead of jumping the view, it simply stops the panning from working).

wim leers’s picture

Bump.

wim leers’s picture

Assigned: balintbrews » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs reroll

utkarsh_33 made their first commit to this issue’s fork.

utkarsh_33’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Rebased with the latest version of 0.x.I am not sure whom to assign this for review so just marking it NR for now.

wim leers’s picture

Marked draft MR as ready for review per @utkarsh_33 in #17.

jessebaker’s picture

Status: Needs review » Closed (outdated)

Thanks for your work on this issue folks. However, I don't believe the original issue reported here can be reproduced any more and the fix implemented in the MR is no longer required.