Skip to content

"Cannot read property 'addEventListener' of undefined" when multiple objects selected #454

@bkowzx

Description

@bkowzx

Environments

  • Framework name: Moveable
  • Framework version: 0.24.5
  • Moveable Component version: 0.24.5
  • Testable Address(optional):

Hello I've ported this example to vue/nuxt and it works for selection of single objects, but when I try to select more than one object either via shift select or drag and select, I get the following error below. It's driving me a bit crazy, so hopefully you might know what the problem is.

Screenshot at 2021-04-19 10-32-30

I've spent some time digging into the package code, and it looks like the problem lies in function below in MoveableGroup, because nextTarget ends up being null. In fact, dragTarget, areaElement, target are all null but not targets which contains the elements I selected.

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

Here is the relevant part of my code which was ported line by line from the React Selecto + Moveable demo mentioned earlier:

Screenshot at 2021-04-19 10-39-00

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions