ember-sortable: Uncaught TypeError after 2.0.1 upgrade

Describe the bug Getting Uncaught TypeError after upgrading to 2.0.1.

To Reproduce Steps to reproduce the behavior:

  1. Going to a page that has an ember-sortable component causes an Uncaught TypeError, and the page fails to load.

Expected behavior No errors

Screenshots image

Additional context This is my template. Please advise if I’ve done something incorrectly. Just a FYI, filteredColumns could be an empty array.

      {{#sortable-group tagName='ul' model=filteredColumns class='column-list value editable' onChange=(action 'reorderColumns') as |group|}}
        {{#each group.model as |column|}}
          {{#group.item class='editable' model=column as |columnItem|}}
            {{#form-button class='remove-meta-key' defaultAction=(action 'removeFromColumns' column)}}
              {{x-icon name='subtract-circle-1'}}
            {{/form-button}}
            <span class='field'>{{column.field}}</span>
            <span title={{column.title}} class='title'>{{column.title}}</span>
            {{#columnItem.handle class='thumb'}}
              {{x-icon name='navigation-drawer-1'}}
            {{/columnItem.handle}}
          {{/group.item}}
        {{/each}}
      {{/sortable-group}}

I’m able to bypass the error if I modify sortable-item’s _tellGroup function like so:

  _tellGroup(method, ...args) {
    let group = this.get('group');

    if (group && group[method]) { // <-- add additional check
      group[method](...args);
    }
  },

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

Hey! I just opened a new issue very similar to this (#363) - @gtb104 if possible could you share how you resolved your this.registerItem is not a function error?