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 #140 empty context #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielsussa
Copy link

@danielsussa danielsussa commented Feb 6, 2023

Fix empty node element:
Uncaught (in promise) TypeError: Cannot set properties of null (setting '__draggable_context')
Simple error handler

const getHtmlElementFromNode = (node) => {
  const el =
      node.el || (Array.isArray(node.children) && node.children[0].el.parentNode);
  return el || {};
};

@marshallswain
Copy link

@danielsussa, thanks for the PR. Since this package and repo appears to be unmaintained, I published your changes to a new package: https://www.npmjs.com/package/@marshallswain/vuedraggable.

This project needs a lot of love. If I can find time, I'll update the tooling to use vitest, vite, and vitepress. It definitely needs a TS rewrite, too.

@marshallswain
Copy link

It looks like the changes break the onDragStart handler., which references this.context.element, but it's undefined. Not sure what's different in my setup.

@danielsussa
Copy link
Author

hey @marshallswain , I will perform some tests with this change with my project. Good to know that you will help to put some love in there!

@danielsussa
Copy link
Author

I just applied an NPM install using your version! Worked pretty!!
Thanks @marshallswain. I can help on further demands.

@zzliux
Copy link

zzliux commented Apr 19, 2023

@marshallswain 感谢,我换成你的包后完美解决draggable与vue3的transition-group不兼容的问题了

@Kill-pig-fly
Copy link

@marshallswain Thank you very much. However, my .list-enter-active and .list-leave-active classes are not being triggered. Only the .list-move class is being applied when removing or adding elements.

code:
tag="transition-group"
:component-data="{tag:'ul',name:'list'}"

@rendomnet
Copy link

when thiss will be merged?

@NtchPlayer
Copy link

NtchPlayer commented Jun 13, 2023

@marshallswain Thank you very much. However, my .list-enter-active and .list-leave-active classes are not being triggered. Only the .list-move class is being applied when removing or adding elements.

code: tag="transition-group" :component-data="{tag:'ul',name:'list'}"

Yes I faced the same issue, .list-enter-active and .list-enter-from is not trigger when I add a element to my list.

@cn-kelon
Copy link

Thank you very much

@icleitoncosta
Copy link

@danielsussa, thanks for the PR. Since this package and repo appears to be unmaintained, I published your changes to a new package: https://www.npmjs.com/package/@marshallswain/vuedraggable.

This project needs a lot of love. If I can find time, I'll update the tooling to use vitest, vite, and vitepress. It definitely needs a TS rewrite, too.

Hello, I noticed that you released the project on NPM but haven't continued with it. I can help maintain it, or we can create a new repository to take over. I'm already doing this for other public projects.

Looking forward to your response. Best regards,

@marshallswain
Copy link

Search for Vue-draggable-plus. The primary language is Chinese and you can switch the docs to English. Those guys have adopted it and made it great. No need to maintain our own.

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.

8 participants