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] Indented text in-between list items can lead to broken drag and drop #531

Open
wwselleck opened this issue Jul 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wwselleck
Copy link

Describe the bug
Putting indented content under a list item can lead to a broken tree if you add additional list items under that content. I'm unsure if there are other scenarios where this happens.

To Reproduce
Steps to reproduce the behavior:

# Initial state
- a<cursor>

# Type: SHIFT+ENTER
- a
  <cursor>
  
# Type: anything
- a
  sometext<cursor>
  
# Move cursor
 - a<cursor>
  sometext

# Type SHIFT+ENTER
- a
  <cursor>
  sometext

# Type HYPHEN SPACE
- a
  - 
  sometext
  
# Drag and drop is now broken for the tree

Expected behavior
Drag and drop continues to work, or some more obvious error is surfaced so the user can fix their tree

Screenshots
image

Environment (please complete the following information):

  • OS: Desktop macOS 14.5
  • Obsidian Version: 1.6.3
  • Plugin Version: 4.8.1

Additional context
Error that gets logged

plugin:obsidian-outliner:1180 Uncaught TypeError: Cannot read properties of null (reading 'getListUnderLine')
    at DragAndDrop.startDragging (plugin:obsidian-outliner:1180:27)
    at DragAndDrop.handleMouseMove (plugin:obsidian-outliner:1098:22)
@wwselleck wwselleck added the bug Something isn't working label Jul 16, 2024
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

1 participant