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: drag behaviour for custom vue component #18

Merged
merged 2 commits into from
Jul 13, 2018
Merged

fix: drag behaviour for custom vue component #18

merged 2 commits into from
Jul 13, 2018

Conversation

v1r0x
Copy link
Contributor

@v1r0x v1r0x commented Jul 13, 2018

Fixes(if relevant):

The drag events don't work with custom vue components in the current version (5.3.2), because event.target is no longer the <a>, but an element inside the custom component. To fix this, I added a function to get the anchor element by going up one level in the DOM until the anchor (class tree-anchor) is found.
I also had to add a check to ondragleave, because the drag event is still fired on the event.target, but this.dropTarget is the anchor (returned by my other function). The function checks if event.target is a child element of this.dropTarget.
There is one lint error left, but I don't know how to fix it. If you could help me again with that, that would be great :)
This patch should fix #7

Checks

  • Contains Only One Commit(git reset then git commit)
  • Build Success(npm run build)
  • Lint Success(npm run lint to check, npm run fix to fix)
  • Add Test(if relevant, npm run test to check)
  • Add Demo(if relevant)

@plantain-00 plantain-00 merged commit 1ee2df5 into plantain-00:master Jul 13, 2018
@v1r0x v1r0x deleted the patch-1 branch July 13, 2018 12:52
@plantain-00
Copy link
Owner

Thanks, it should be available in v5.3.3

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.

Dragging not fully working in Firefox
2 participants