Interface: AnnotationsFocusEvent

PSPDFKit.AnnotationsFocusEvent

This event is emitted whenever an annotation is focused.

Use this event to add custom behavior like announcing the annotation value to screen readers.

Example

Log text annotation value

instance.addEventListener("annotations.focus", (event) => {
  if (event.annotation instanceof PSPDFKit.Annotations.TextAnnotation) {
    console.log(event.annotation.text);
  }
});

Members




Members

annotation: PSPDFKit.Annotations

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

Type:

(nullable) formField: FormField

When the focused annotation is a WidgetAnnotation the event contains the FormField associated to it.

Type:
  • FormField

nativeEvent: Event

The browser event FocusEvent which caused the annotations.focus event to dispatch. Its type property is set to focus.

Type:
  • Event