mouseHold property

void Function(InputEvent, GraphObject)? get mouseHold

Gets or sets the function to execute when the user holds the mouse still for a while over this object while holding down a button. This property is used by the ToolManager.

If this property value is a function, it is called with an InputEvent. By default this property is null.

If you do provide a function that makes changes to the diagram or to its model, you should do so within a transaction -- call Diagram#startTransaction and Diagram#commitTransaction.

You can control how long the user must wait during a drag with a motionless mouse before a "mouse hold" event occurs, by setting ToolManager#holdDelay. For example:

myDiagram = new go.Diagram("myDiagramDiv",
    { "toolManager.holdDelay": 500 });  // 500 milliseconds

or:

myDiagram.toolManager.holdDelay = 500;  // 500 milliseconds

Implementation

void Function(
  _i3.InputEvent,
  _i3.GraphObject,
)? get mouseHold => (
      _i3.InputEvent p0,
      _i3.GraphObject p1,
    ) =>
        _i4.callMethod(
          _i4.getProperty(
            this,
            'mouseHold',
          ),
          r'call',
          [
            this,
            p0,
            p1,
          ],
        );
set mouseHold (void value(InputEvent, GraphObject)?)

Implementation

set mouseHold(
    void Function(
      _i3.InputEvent,
      _i3.GraphObject,
    )? value) {
  _i4.setProperty(
    this,
    'mouseHold',
    value == null ? _i5.undefined : _i4.allowInterop(value),
  );
}