Skip to content

TypeError: Cannot read property 'children' of null #46

@crstffr

Description

@crstffr

Using a basic implementation of Sortable, I get the following errors thrown continuously as I drag my element around the page. Although it throws nonstop errors, the drag/drop/sort does function correctly.

untitled

Environment

  • OSX 10.12.6
  • Chrome Version 61.0.3163.100 (Official Build) (64-bit)

Error

sortable.js:117 Uncaught TypeError: Cannot read property 'children' of null
    at c (sortable.js:117)
    at a.value (sortable.js:83)
    at a.value (draggable.js:173)
    at a.value (draggable.js:273)
    at a.value (draggable.js:370)
    at g.value (sensor.js:19)
    at g.value (mouse-sensor.js:85)
c @ sortable.js:117
value @ sortable.js:83
value @ draggable.js:173
value @ draggable.js:273
value @ draggable.js:370
value @ sensor.js:19
value @ mouse-sensor.js:85

Simplified Markup

<draggable-container>
  <div ng-if="$ctrl.ready">

    <device-group>
      <button class="drag-handle">
        <i class="fa fa-bars"></i>
      </button>
      <!-- contents item 1-->
    </device-group>  

    <device-group>
      <button class="drag-handle">
        <i class="fa fa-bars"></i>
      </button>
      <!-- contents item N -->
    </device-group> 

  </div>
</draggable-container>

Javascript

let $container = $('draggable-container');
let inst = new Sortable($container, {
  draggable: 'device-group',
  handle: '.drag-handle',
  delay: 200
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions