Nutrient Web SDK
    Preparing search index...

    Interface AnnotationsPressEvent

    This event is emitted whenever an annotation is either clicked or touched (on devices with touch capabilities) as well as when an already selected annotation receives a click or touch event.

    Use this event to add custom behavior or prevent default ones from happening on press.

    Please note that this event will not be fired for annotations which are not editable. If you still want to detect clicks for such annotations, for example, to show a focus ring when clicked, you can use custom renderers to made a clickable area above each annotation. This method is described fully in our Knowledge Base.

    Prevent click and touch events on selected annotations

    instance.addEventListener("annotations.press", (event) => {
    if (event.selected) {
    event.preventDefault();
    }
    });
    interface AnnotationsPressEvent {
        annotation: AnnotationsUnion;
        nativeEvent: Event;
        preventDefault?: () => void;
        selected: boolean;
    }
    Index

    Properties

    annotation: AnnotationsUnion

    The annotation that was pressed. Remember that annotations are Immutable.map.

    nativeEvent: Event

    The browser event which caused the press event to dispatch. This is either a MouseEvent, TouchEvent, or a PointerEvent.

    preventDefault?: () => void

    When invoked, the preventDefault method prevents the default press actions associated with the annotation to occur.

    selected: boolean

    Tells whether the pressed annotation is selected or not.