(bug) Opening link should NOT create random text selection

Use case or problem

In editing modes (“Live Preview”, “Legacy Editor”), Link opens when mouse button is pressed down which causes undesired text selection and is not consistent with behavior in “reading mode” and in other software. Unnoticed text selection can lead to data loss e.g. when user starts writing after opening the file.

Steps to reproduce

  • Create file A and fill it by sufficient amount of text to fill the screen area.
  • In some file B create link to file A

First, for reference to see expected behavior:

  • Open in reading mode (rendered html) file B, that contains link file A
  • Position cursor over link.
  • Press down mouse button on the link
  • Move the cursor few pixels within tolerance so that cursor stays over the link and no attempt to drag is indicated. (That happens when we move cursor larger distance.)
  • Release the mouse button
  • the link target (file A) is opened upon release. This is consistent e.g. with behavior of links in Google Chrome and IMHO it works well.

Now see the issue in editing modes:

  • Open either in “Live Preview” or in “Legacy Editor” the file B that contains link.
  • Position cursor over link.
  • Press down Ctrl key (and hold it)
  • Press down mouse button on the link
  • In Obsidian v0.13.14, link immediately opens
  • Any slight movement of cusor places caret into text under cursor and text selection is initiated.

Aim:
During Ctrl+Click in any editing mode, mouse button being pressed down before opening link-target-file should not initiate selection in that file.

Proposed solution

Instead of opening link when button is pressed down, link should rather open when mouse button is released. Just like in reading view except the requirement for modifier.

Additional info:
In practice the movement is not intended but is often hard or impossible to avoid.
People use diverse devices to control the cursor ( mouse, tablet pen, trackpoint, touchpad, camera,… ) so Ideally, the tolerated distance of cursor movement would be adjustable e.g. in some deeply buried setting or config file.

Update 2022-06-28: In Obsidian v0.14.15 this issue appears fixed.
I suspect it was fixed in Obsidian v0.13.25.
Thank you

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.