Interface: AnnotationsOnPressEvent

PSPDFKit.AnnotationsOnPressEvent

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.

Example

Prevent click and touch events on selected annotations

instance.addEventListener("annotations.onPress", (event) => {
  if (event.selected) {
    event.preventDefault();
  }
});

Members




Members

annotation: PSPDFKit.Annotations

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

Type:

nativeEvent: PointerEvent

The browser event which caused the onPress event to dispatch.

Type:
  • PointerEvent

preventDefault: function

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

Type:
  • function

selected: boolean

Tells whether the pressed annotation is selected or not.

Type:
  • boolean