pdftron-react-native icon indicating copy to clipboard operation
pdftron-react-native copied to clipboard

Annotation dialog "delete all" buttons don't call listeners (Android)

Open akwanpdf opened this issue 4 years ago • 1 comments

Describe the bug In Android, deleting multiple annotations using "Delete all annotations on page " or "Delete all annotations in the document" buttons do not call handleAnnotationChanged nor handleExportAnnotationCommand.

Steps to Reproduce the Problem

  1. Use debug mode and run the example app in an Android device.
  2. Create multiple annotations (e.g. highlight two different words).
  3. Click the icon at the bottom-right of the screen to access Bookmarks dialog.
  4. Click the right-most tab to access Annotation tab.
  5. Long press on any annotation and a list of options should appear: "Delete this annotation", "Delete all annotations on page 1", and "Delete all annotations in the document" (see screenshot below).
  6. Set a breakpoint at handleAnnotationChanged nor handleExportAnnotationCommand in android/src/main/java/com/pdftron/reactnative/views/DocumentView.java.
  7. Click "Delete all annotations on page 1" or "Delete all annotations in the document".
  8. The breakpoints are not hit.

Expected behavior Because annotations were changed (deleted), I expected handleAnnotationChanged and handleExportAnnotationCommand breakpoints to be hit.

Screenshots image

Platform/Device Information (please complete the following information if applicable):

  • Platform: Android
  • Device: Google Pixel 4 API 29 virtual device
  • OS: Android 10.0

akwanpdf avatar Jun 24 '21 00:06 akwanpdf

alternative would be to enable annotation manager instead which will be able to handle these two cases correctly

sgong-pdftron avatar Mar 03 '22 18:03 sgong-pdftron