obsidian-annotator icon indicating copy to clipboard operation
obsidian-annotator copied to clipboard

When click the link in markdown and jump to annotation in pdf, I can't show all annotations. The pdf is always focused on the same annotation.

Open ruanwz opened this issue 2 years ago • 2 comments

When click the link in markdown and jump to annotation in pdf, I can't show all annotations. The pdf is always focused on the same annotation. If I scroll the pdf to other pages, it will scroll back to the annotation position where I click the link related.

The show all button does nothing.

The only way to unlock the focus is:

  1. click open as markdown in options, then
  2. reopen as annotation

ruanwz avatar Apr 21 '22 09:04 ruanwz

I meet the same problem.

jjzixue avatar May 06 '22 15:05 jjzixue

In order to fix this temporally, I changed following lines to enable scrolling from the jumped position.

diff --git a/src/annotatorView.tsx b/src/annotatorView.tsx
index 34ecc82..c32fc01 100644
--- a/src/annotatorView.tsx
+++ b/src/annotatorView.tsx
@@ -300,12 +300,12 @@ export default class AnnotatorView extends FileView {
 
                 newYOffset = document.getElementsByTagName('hypothesis-highlight')[0].getBoundingClientRect().y;
                 if (newYOffset != yoffset && annotationTargetType == 'pdf') {
-                    yoffset = newYOffset;
-                    setTimeout(g, 100);
+                    //yoffset = newYOffset;
+                    //setTimeout(g, 100);
                 }
             } catch (e) {
                 if (annotationTargetType == 'pdf') {
-                    setTimeout(g, 100);
+                    //setTimeout(g, 100);
                 } else if (this.plugin.settings.debugLogging) {
                     console.error(e);
                 }
@@ -313,9 +313,9 @@ export default class AnnotatorView extends FileView {
         };
         this.activeG = g;
         try {
-            setTimeout(function () {
-                g();
-            }, 1000);
+            //setTimeout(function () {
+            //    g();
+            //}, 1000);

ruanwz avatar Jun 06 '22 14:06 ruanwz