Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Add a check that makes it not work for dragging into anything except a standard markdown view edit mode (for now) #32

Open
GitMurf opened this issue Oct 27, 2021 · 4 comments

Comments

@GitMurf
Copy link
Owner

GitMurf commented Oct 27, 2021

Thanks @zsviczian … I have been having a lot of issues like this with a lot of different plugins that have their own views types.

To get it released I am probably going to add a check that makes it not work for dragging into anything except a standard markdown view edit mode.

But excalidraw is the first plugin I plan to “optimize” for in an early update after initial release to the community plugin store.

so many darn corner cases to handle with drag and drop!!

Originally posted by @GitMurf in #30 (comment)

@GitMurf GitMurf changed the title Add a check that makes it not work for dragging into anything except a standard markdown view edit mode Add a check that makes it not work for dragging into anything except a standard markdown view edit mode (for now) Oct 27, 2021
@zsviczian
Copy link

zsviczian commented Oct 27, 2021 via email

@GitMurf
Copy link
Owner Author

GitMurf commented Oct 27, 2021

@zsviczian so if I am understanding you correctly, basically a way where when I detect a non standard pane/view being dragged over and dropped into, instead of completely stopping it from working (like I proposed in this Issue), simply allow it to add the block reference to the drag event and then allow the native drag and drop Obsidian core to process the drop (as if my plugin didn’t exist). Then this would allow another plugin (like Excalidraw) to also decide how to handle the Drop event if they want to do something else with the dropped text.

So in summary, if my plugin detects being dropped into a non standard markdown edit view/pane then update the text accordingly in the Drag Event data (e.g. block reference or copied dragged block text) but then do not process the Drop event with my plugin and instead allow it to be handled by obsidian Native and/or another plugin that decides to tap into the Drop event. Does that make sense? Is this what you were suggesting?

@zsviczian
Copy link

zsviczian commented Oct 27, 2021 via email

@GitMurf
Copy link
Owner Author

GitMurf commented Oct 27, 2021

Cool. I will implement this and let you know when ready to test.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants