GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Panning stays engaged when the mouse button is released outside the window · Issue #1300 · maxGraph/maxGraph

Panning stays engaged when the mouse button is released outside the window #1300

New issue
Copy link
New issue
Copy link
Open
Open
Panning stays engaged when the mouse button is released outside the window#1300
Copy link
Labels
bugSomething isn't workingtriageIssue/PR under review for categorization

Description

@redfish4ktc
redfish4ktc
opened on Oct 31, 2026
Issue body actions

Describe the bug

Note

This report comes from an analysis of the code, not from a reproduction. The behaviour described below has not been observed in maxGraph yet and must be verified first. It is expected to occur, since maxGraph has the same code as mxGraph here, and draw.io changed that code to fix it.

When the mouse button is released outside the browser window during a pan, maxGraph probably misses the release:

  1. Panning stays engaged. PanningHandler stops panning on a mouseup listener registered on document (PanningHandler.ts#L118-L125). A release outside the window does not reach that listener, so when the mouse comes back, the graph may keep panning although no button is pressed.
  2. The graph keeps believing the button is down. graph.isMouseDown is only reset when the graph itself receives the mouseup (EventsMixin.ts#L502-L503), and PanningHandler.reset() does not touch it (PanningHandler.ts#L438-L444). While it stays true, isEventIgnored drops the next mousedown as out of sequence (EventsMixin.ts#L508-L520), and mouse moves trigger the auto scroll reserved for drags (EventsMixin.ts#L680-L686).

Both points are inferred from reading the code. Their visible effect, and whether a later event resynchronises the state, are part of what the verification has to establish.

To Reproduce

Not reproduced yet. Suggested steps to verify:

  1. Open a story with panning enabled, for instance any story calling graph.setPanning(true).
  2. Start panning with the mouse (right button, or as configured), move the pointer out of the browser window, and release the button there.
  3. Move the pointer back over the graph without pressing any button: check whether the graph still pans.
  4. Click a cell: check whether the click is taken into account or ignored.

Expected behavior

Releasing the button outside the window ends the pan, and the graph no longer considers the button pressed.

mxGraph behaves like maxGraph here: it only listens to mouseup on document (mxPanningHandler.js#L98-L99) and its reset() does not touch isMouseDown. So if the bug exists, it also existed in mxGraph.

draw.io, where jgraph kept developing mxGraph after the archival of jgraph/mxgraph, fixed it with two changes that work together. They first shipped in release 14.1.3 (commit 16d9dab274eb440926def4d53b9e7d4d52b7763a, 2020-12-28), and are still present today (mxPanningHandler.js at the current dev branch):

  • the release listener also fires when the mouse leaves the window, and covers touch and pointer releases (L98-L101, removed accordingly in destroy at L497-L498):

    mxEvent.addGestureListeners(document, null, null, this.mouseUpListener);
    mxEvent.addListener(document, 'mouseleave', this.mouseUpListener);
  • reset(), which that listener calls, also resets the mouse state of the graph (L469):

    this.graph.isMouseDown = false

maxGraph already provides InternalEvent.addGestureListeners and removeGestureListeners, so porting the fix would be a few lines in PanningHandler, plus tests.

Environment

  • maxGraph version or commit: all versions up to 0.25.1, code still present on main at 6df0cfd
  • Desktop or mobile: desktop expected, touch not analysed
  • Browser and version: not verified

Additional context

The gap was found while setting up the mxgraph-archaeologist agent of the repository (#1302), during one of its validation runs comparing PanningHandler with its mxGraph original and its current draw.io version.

Until release 22.0.0, the draw.io repository held no mxGraph source code, only the minified mxGraph bundle mxClient.js. The fix therefore first appears there in minified form, in 14.1.3. The mxGraph source code was first published in 22.0.0 (commit 8906f90ac0cc50a0c6da77c28cf9b2b2339277b1, 2023-09-28), with the fix already in (mxPanningHandler.js#L100-L101 and L469). No public commit shows the change as a readable diff.

Activity

  1. redfish4ktc
    added
    bugSomething isn't working
    triageIssue/PR under review for categorization
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue/PR under review for categorization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.