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
- Start panning by middle clicking with a mouse inside the iframe/preview close to its edge;
- Move your mouse fast so that the cursor crosses the boundary of the iframe/preview and the canvas;
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| xb-middle-click+drag-fast.gif | 778.07 KB | balintbrews |
Issue fork experience_builder-3466063
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:
- 3466063-middle-click-issue
changes, plain diff MR !175
- 3466063-Middle-click
changes, plain diff MR !148
Comments
Comment #2
balintbrewsComment #3
gauravvvv commentedComment #5
gauravvvv commentedComment #6
jessebaker commentedThis 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.
Comment #7
fazilitehreem commentedComment #9
fazilitehreem commentedRaised new MR for middle click +drag issue
Comment #10
fazilitehreem commentedComment #12
wim leersRequesting review from @jessebaker since he previously reviewed this in #6.
Comment #13
jessebaker commented@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).
Comment #14
wim leersBump.
Comment #15
wim leersComment #17
utkarsh_33 commentedRebased with the latest version of 0.x.I am not sure whom to assign this for review so just marking it NR for now.
Comment #18
wim leersMarked draft MR as ready for review per @utkarsh_33 in #17.
Comment #19
jessebaker commentedThanks 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.