Events

annotations.press

Detailed viewer event reference for annotations.press.

Summary

  • Category: Annotations
  • Event: annotations.press
  • Trigger: Fires when an annotation press interaction occurs.

Payload

[AnnotationPressEventPayload];

Payload fields

The first argument is an annotation list with compatibility fields attached:

  • annotation: first pressed annotation, when available.
  • annotations: same list value (compat alias).
  • nativeEvent: source pointer event.
  • preventDefault: cancels default press behavior, including built-in link navigation.
  • stopPropagation: calls nativeEvent.stopPropagation() on the source event.

Subscription example

function onEvent(payload) {
  console.log('annotations.press', payload);
}

instance.addEventListener('annotations.press', onEvent);
instance.removeEventListener('annotations.press', onEvent);