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

On mobile (Android), cannot open a note from the Board view

Open studokim opened this issue 1 year ago • 2 comments

What happened?

The note is not opened, got black (presumably webview) screen instead:

image

What did you expect to happen?

The note should be opened. Just like when clicking on it from the Table view (which works fine).

How can we reproduce it (as minimally and precisely as possible)?

  1. have a project with notes
  2. take an Android phone
  3. open Board view
  4. click on any note title (the underlined href)

Anything else we need to know?

I'm not a JS programmer, but wanted a quick fix for myself. So by directly editing compiled main.js, found the following solution:

...
+// main.js, line 37503 as of 1.17.1 release
function instance21($$self, $$props, $$invalidate) {
+  let $app; // copied from event handler used in the Table view
+  component_subscribe($$self, app2, ($$value) => $$invalidate(6, $app = $$value)); // copied from event handler used in the Table view
  let { $$slots: slots = {}, $$scope } = $$props;
  let { linkText } = $$props;
  let { sourcePath } = $$props;
  let { tooltip = "" } = $$props;
  let { resolved } = $$props;
  const dispatch2 = createEventDispatcher();
  let aria = {};
  if (tooltip) {
    aria = {
      "aria-label": tooltip,
      "aria-label-position": "top"
    };
  }
-  const click_handler2 = (event) => {
-    event.stopPropagation();
-    dispatch2("open", {
-      linkText,
-      sourcePath,
-      newLeaf: event.ctrlKey || event.metaKey
-    });
-  };
+const targetEl = event.target;
+    const closestAnchor = targetEl.tagName === "A" ? targetEl : targetEl.closest("a");
+    if (!closestAnchor) {
+      return;
+    }
+    if (closestAnchor.hasClass("internal-link")) {
+      event.preventDefault();
+      const href = closestAnchor.getAttr("href");
+      const newLeaf = event.button === 1 || event.ctrlKey || event.metaKey;
+      if (href) {
+        $app.workspace.openLinkText(href, sourcePath, newLeaf);
+      }
+    }
...

Plugin version

1.17.1

Obsidian version

1.4.16 (114)

OS

Other

studokim avatar Jan 21 '24 12:01 studokim

I'm running in the same issue. Commenting to track any progress..

brunodd avatar Mar 02 '24 10:03 brunodd

Bump. Obsidian 1.5.12 (134). Projects 1.17.3. Error page when clickig note on board, calendar views. But table view is correct

ilyaChuk avatar May 01 '24 23:05 ilyaChuk