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

Unable to use groups after initialization #114

Open
dartanian300 opened this issue Mar 1, 2020 · 3 comments · May be fixed by #332
Open

Unable to use groups after initialization #114

dartanian300 opened this issue Mar 1, 2020 · 3 comments · May be fixed by #332
Labels
bug 🐛 Something isn't working

Comments

@dartanian300
Copy link

Based on the Moveable documentation (found here: https://github.com/daybrush/moveable/blob/0.13.4/handbook/handbook.md#toc-group), you can create a group of moveable elements by passing an array to the target property. However, doing so in vue-moveable after initialization throws the following error:

Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of undefined

I've confirmed that this occurs no matter the type of elements. It's present with both div and svg. Additionally, if the array has only a single element in it, this error does not occur.

Demo:
https://codesandbox.io/s/vue-moveable-group-problem-9r6sf?fontsize=14&hidenavigation=1&theme=dark

Vue-Moveable version: 1.4.0

@probil probil added the bug 🐛 Something isn't working label Mar 13, 2020
@probil
Copy link
Owner

probil commented Mar 13, 2020

Hi @dartanian300 👋
Thanks for your issue. Groups are not supported right now. Some work was done in v1.6.0 to make it work properly but it still needs testing

@bkowzx
Copy link

bkowzx commented Apr 19, 2021

Any updates on when groups will be supported? I am having the same issue unfortunately. Digging into this package and moveable package to figure out why it's doing this. While debugging, it turns out that nextTarget is null because dragTarget and areaElement are both null -- this leads to the Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of undefined error. This is in the updateEvent function for MoveableGroup in the Moveable package.

Screenshot at 2021-04-19 10-34-46

@bkowzx
Copy link

bkowzx commented Apr 19, 2021

Finally figured out what the problem was. Boolean props have a default value of False. This was screwing everything up. I replaced every Boolean prop value from Boolean to {type: Boolean, required: false, default: undefined } in Moveable.vue component, and it worked! So I believe that's the fix that needs to be made in this package for groups to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants