Problem/Motivation
Work to improve the UX of the panning/zooming of the canvas has been done - the controls are now using the canvas' scroll position rather than translating the div with CSS - this means using a trackpad on a mac works.
When using a mouse, a user should be able to hold middle mouse button and drag to pan around. This works if the user's initial middle mouse click is outside of the preview iframe but does not work if that initial click is somewhere inside the iFrame.
Steps to reproduce
Move your mouse outside of the iframe
Click and hold down the middle mouse button
Move the mouse
observe that the canvas view pans around
release the middle mouse button.
Now
Move your mouse OVER the iframe
Click and hold down the middle mouse button
Move the mouse
observe that the canvas view DOES NOT pan around
release the middle mouse button.
Proposed resolution
On mouse down, I set the iFrame's CSS pointer-event property to 'none' - hoping that the mouse move will then be on the parent document however this doesn't work.
A different solution is required - perhaps displaying a transparent div on middlemouse down over the iframe that intercepts the mousemove events?
Perhaps using postmessages to pass the mousemove events from the iframe up to the parent?

| Comment | File | Size | Author |
|---|---|---|---|
| 2024-07-02 14.18.57.gif | 7.79 MB | jessebaker |
Issue fork experience_builder-3458535
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:
- 3458535-test-gitlab-ci
changes, plain diff MR !145
- 0.x
changes, plain diff MR !79
Comments
Comment #2
jessebaker commentedComment #3
lauriiiComment #4
balintbrewsComment #6
wim leers@jessebaker provided feedback — do you think you could address that, @balintbrews? 😊
Comment #7
balintbrewsComment #8
balintbrewsComment #9
wim leers@balintbrews: FYI: @jessebaker pushed a commit and commented on the MR 😊 (Just in case you missed that.)
Comment #10
balintbrewsNew issue has been created for that remaining bug: #3466063: Middle click + drag and moving fast with the mouse miscalculates canvas scroll position.
Comment #13
bnjmnmI added the 3458535-test-gitlab-ci branch to help narrow down the Cypress tests CI job dying before Cypress can even begin. Turns out I didn't have to do anyting other than possibly getting it current with 0.x - if it's easiest to continue work on that branch that's fine - the only difference is it is current.
Tagging with needs tests. This should be testable since cypress-real-events supports middle-clicks.
Comment #15
jessebaker commentedComment #17
wim leers… but I think we'll still want a second MR for this issue, to add tests, as requested by @bnjmnm in #13? 😊😇
Comment #18
balintbrewsComment #19
jessebaker commentedFixed in #3475759: Implement a different approach to the iFrame preview interactions