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?

CommentFileSizeAuthor
2024-07-02 14.18.57.gif7.79 MBjessebaker
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

jessebaker created an issue. See original summary.

jessebaker’s picture

Status: Postponed » Active
lauriii’s picture

balintbrews’s picture

Assigned: Unassigned » balintbrews

wim leers’s picture

Status: Active » Needs work

@jessebaker provided feedback — do you think you could address that, @balintbrews? 😊

balintbrews’s picture

Status: Needs work » Needs review
balintbrews’s picture

Status: Needs review » Needs work
wim leers’s picture

@balintbrews: FYI: @jessebaker pushed a commit and commented on the MR 😊 (Just in case you missed that.)

balintbrews’s picture

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

bnjmnm’s picture

Issue tags: +Needs tests

I 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.

  • jessebaker committed 8dbcceac on 0.x authored by bnjmnm
    Issue #3458535 by balintbrews, jessebaker: Middle click + drag doesn't...
jessebaker’s picture

Status: Needs work » Fixed

wim leers’s picture

Status: Fixed » Needs work

… but I think we'll still want a second MR for this issue, to add tests, as requested by @bnjmnm in #13? 😊😇

balintbrews’s picture

Assigned: balintbrews » Unassigned
jessebaker’s picture

Version: » 0.x-dev
Status: Needs work » Closed (outdated)