Function overrideCursor

  • Override the cursor icon for the entire document.

    Parameters

    • cursor: string

      The string representing the cursor style.

    • doc: Document | ShadowRoot = document

    Returns IDisposable

    A disposable which will clear the override when disposed.

    Notes

    The most recent call to overrideCursor takes precedence. Disposing an old override has no effect on the current override.

    This utility function is used by the Drag class to override the mouse cursor during a drag-drop operation, but it can also be used by other classes to fix the cursor icon during normal mouse drags.

    Example

    import { Drag } from '@lumino/dragdrop';

    // Force the cursor to be 'wait' for the entire document.
    let override = Drag.overrideCursor('wait');

    // Clear the override by disposing the return value.
    override.dispose();