Skip to content

Interface: InfiniteCanvasEventWithDefaultBehavior

This represents an a DOM event to which InfiniteCanvas attaches a default behavior.

Example

js
infCanvas.addEventListener('mousedown', e => {
    console.log(e.nativeDefaultPrevented)
    // --> `false`

    // keep the InfiniteCanvas from panning
    e.preventDefault(true);

    console.log(e.nativeDefaultPrevented);
    // --> `true`, because the original mouse event's default was also prevented
});

Properties

nativeCancelable

Readonly nativeCancelable: boolean

Returns whether the default for the original DOM event is cancelable

Defined in

infinite-canvas-event-with-default-behavior.ts:26


nativeDefaultPrevented

Readonly nativeDefaultPrevented: boolean

Returns whether the default for the original DOM event was prevented

Defined in

infinite-canvas-event-with-default-behavior.ts:22

Methods

preventDefault

preventDefault(preventNativeDefault?): void

Prevents InfiniteCanvas's default behavior from occuring

Parameters

NameTypeDescription
preventNativeDefault?booleanwhether or not to also prevent the default behavior of the 'native' event

Returns

void

Defined in

infinite-canvas-event-with-default-behavior.ts:31