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

Drag and drop functionality #1

Open
jelleroorda opened this issue Jul 13, 2022 · 5 comments
Open

Drag and drop functionality #1

jelleroorda opened this issue Jul 13, 2022 · 5 comments

Comments

@jelleroorda
Copy link

Hey @sereneinserenade, great work!

I'm just leaving a feature request here after checking out the demo. It would be great if it were possible to drag and drop media to other places in the text. For example, when you add an image and then float it left. It would be great if you could drag it in front of some text so the text would go around the image.

@sereneinserenade
Copy link
Owner

sereneinserenade commented Jul 13, 2022

Hi @jelleroorda thank you very much!

That's actually a very nice touch. I'd have to research and play around a bit to see how that would become possible in code. In the meantime, let me know if you already have any insight on how to implement this

@mrcego
Copy link

mrcego commented Apr 19, 2023

Hey @sereneinserenade!

Your extension is very useful. I'm learning how to create extension for Tiptap, and my main goal is "merging" your Extension with coolswitch extension for Drag And Drop and upload support, in case of images I mean. I'm rushing about it and try to understand how to do that, but both logics, at least for me, are uneven. Would you mind putting in the right direction to do this? This process would be end in a PR for the extension.

Thanks in advanced if any help is available.

@sereneinserenade
Copy link
Owner

hey, @mrcego

I've already made a pasteDropPlugin for it. here's a link

hope that helps

@mrcego
Copy link

mrcego commented Apr 19, 2023

hey, @mrcego

I've already made a pasteDropPlugin for it. here's a link

hope that helps

I have implemented the plugin, but I'm facing two issues now:

  1. The uploaded image is not being shown in the editor. The weird thing here is, log is showing image in the object from editor. And when save code in the VSCode, image is shown, so, reactivity issue here??

  2. Position menu from uploaded image when I hover it is not shown, probably because is not wrapped into ResizableMediaNodeView.vue component as article tag.

Could I sharing with you a repro link, if you have time to check it?

@pbell23
Copy link

pbell23 commented Oct 29, 2023

For the drag and drop functionality, I added the data-drag-handle attribute to the img element to make it work :

<img
          v-if="mediaType === 'img'"
          v-bind="node.attrs"
          ref="resizableImg"
          class="rounded-lg"
          :class="[`${isFloat && `float-${props.node.attrs.dataFloat}` || ''}`, `${isAlign && `align-${props.node.attrs.dataAlign}` || ''}`]"
          draggable="true"
          data-drag-handle
        >

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

No branches or pull requests

4 participants