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

fix: Draggable nodes should respect drag handles #3677

Merged

Conversation

matthewmullin01
Copy link
Contributor

@matthewmullin01 matthewmullin01 commented Jan 30, 2023

Fixes #3518

It's possible to drag an interactive node view without using the drag handle. The drag doesn't actually do anything, presumably because it only works when the drag handle is used.

With this fix nodes are only draggable via their drag handle. I believe this is the intended behaviour if I look at the docs

To make your node views draggable, set draggable: true in the extension and add data-drag-handle to the DOM element that should function as the drag handle.

Before After
Screen.Recording.2023-01-30.at.11.52.17.AM.mov
Screen.Recording.2023-01-30.at.11.56.18.AM.mov

How to test

  • Check the latest deploy preview DragHandle page here. Ensure that nodes are only draggable by the drag handle.

@netlify
Copy link

netlify bot commented Jan 30, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit e2e9dae
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/63e295c57ee3f70008330b9c
😎 Deploy Preview https://deploy-preview-3677--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@matthewmullin01 matthewmullin01 changed the title Fix/drag not respecting handles fix: Draggable nodes respect drag handles Jan 30, 2023
@matthewmullin01 matthewmullin01 marked this pull request as draft January 30, 2023 19:41
@matthewmullin01 matthewmullin01 marked this pull request as ready for review January 30, 2023 20:19
@matthewmullin01 matthewmullin01 changed the title fix: Draggable nodes respect drag handles fix: Draggable nodes should respect drag handles Jan 30, 2023
bdbch
bdbch previously approved these changes Feb 7, 2023
@matthewmullin01
Copy link
Contributor Author

Thanks for the review @bdbch! Just had some last min conflicts to solve, otherwise it's exactly as it was before.

@bdbch bdbch merged commit 2b6e4e3 into ueberdosis:main Feb 9, 2023
aliasliao pushed a commit to aliasliao/tiptap that referenced this pull request May 24, 2023
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

Successfully merging this pull request may close these issues.

Interactive node views can be dragged bypassing the drag handle (to no avail)
2 participants