Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Drag & drop failing on Obsidian 1.5.3 (Installer 1.5.3) #506

Open
shawnyeager opened this issue Feb 2, 2024 · 15 comments
Open

[BUG] Drag & drop failing on Obsidian 1.5.3 (Installer 1.5.3) #506

shawnyeager opened this issue Feb 2, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@shawnyeager
Copy link

Describe the bug
I'm unable to drag & drop using both Default and Minimal themes.

To Reproduce
Steps to reproduce the behavior:

  1. Grab icon appears while hovered over item
  2. Click to grab
  3. Attempt to drag

Expected behavior
The item moves with the cursor

Environment (please complete the following information):

  • OS: macOS 14.3
  • Obsidian Version: Version 1.5.3 (Installer 1.5.3)
  • Plugin Version: 4.8.0
@shawnyeager shawnyeager added the bug Something isn't working label Feb 2, 2024
@imdadkadir
Copy link

@charlie17
Copy link

I have discovered something by accident - DnD seems to work properly when all outline nodes in the file are expanded. As soon as some are collapsed it stops working. See if this happens for you?

@shawnyeager
Copy link
Author

Unfortunately, that doesn't appear to be the case for me. After running Unfold all headings and lists, drag and drop still fails.

@charlie17
Copy link

Yes, I tried it in some different files and found I couldn't repeat what I found before. There is something going on where it sometimes works, but I can't crack the case on exactly what that is. Frustrating as DnD is very helpful on the few occasions where it does work

@HWiwoiiii
Copy link

same here

@TonyDobbs
Copy link

I'm experiencing the same issue. Has anyone tried the fix recommended by @imdadkadir ?

@charlie17
Copy link

I'm experiencing the same issue. Has anyone tried the fix recommended by @imdadkadir ?

I saw that but haevn't tried it only because DnD doesn't work even in cases where I don't have any front matter

@TonyDobbs
Copy link

I'm experiencing the same issue. Has anyone tried the fix recommended by @imdadkadir ?

I saw that but haevn't tried it only because DnD doesn't work even in cases where I don't have any front matter

Sorry about that @charlie17 I wasn't looking carefully. I just submitted a PR to resolve this issue.

@kvikindi
Copy link

kvikindi commented Mar 23, 2024

I'm on v1.5.11, and the only way to get DnD to work, is if "Properties in Document" is set to "Source" (under Options - Editor - Display).

  • edit: I tried the fix linked above, and it works in Live Preview.

@candideu
Copy link

Same issue for me

@TonyDobbs
Copy link

Same issue for me

Hi @candideu did you try my patch above?

@candideu
Copy link

candideu commented Apr 12, 2024

@TonyDobbs I did. Based on your commit, I went to [my vault]\.obsidian\plugins\obsidian-outliner, opened main.js in a text editor, found the following line (L1310):

      v.top = view.coordsAtPos(linePos, -1).top;

and replaced it with this:

      const coords = view.coordsAtPos(linePos, -1);
      const vTop = coords ? coords.top : 0;
      v.top = vTop;

Then I restarted Obsidian. Unfortunately, it's still not working for me...

@TonyDobbs
Copy link

@TonyDobbs I did. Based on your commit, I went to to [my vault]\.obsidian\plugins\obsidian-outliner, opened main.js in a text editor, found the following line (L1310):

      v.top = view.coordsAtPos(linePos, -1).top;

and replaced it with this:

      const coords = view.coordsAtPos(linePos, -1);
      const vTop = coords ? coords.top : 0;
      v.top = vTop;

Then I restarted Obsidian. Unfortunately, it's still not working for me...

@candideu Ah I think the issue is that if you only update main.js you won't see the changes, because it's using a minified version. You will need to update the code in that file as well.

@candideu
Copy link

You will need to update the code in that file as well.

@TonyDobbs Sorry in which file?

I ended up combining your changes with the changes described in the forum post that was shared earlier in this thread in main.js, and it looks like that worked.

@TonyDobbs
Copy link

You will need to update the code in that file as well.

@TonyDobbs Sorry in which file?

I ended up combining your changes with the changes described in the forum post that was shared earlier in this thread in main.js, and it looks like that worked.

Hi @candideu My apologies, main.js was the correct file. I was mistaken. Based on your reply, it seems that you may have been using frontmatter. So there were 2 bugs to patch not one. I'm glad to hear you got it working! Hopefully both patches make it into the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants