adopted-ember-addons / ember-sortable

Sortable UI primitives for Ember.js
https://ember-sortable.netlify.app/
MIT License
298 stars 148 forks source link

`.sortable-item` class is not applied to updated rows within ember-table #514

Open rreckonerr opened 1 year ago

rreckonerr commented 1 year ago

Describe the bug I'm using ember-sortable v4.0.3 to reorder the rows within ember-table v5.0.0. Initially, when rows are rendered, .sortable-item class is applied to the rows, but after updating the array according to the reordered data .sortable-item class is not re-applied.

After the reorder is done, sortable-item modifier update is not triggered.

<EmberTable
  as |et|
>
  <et.body
    {{sortable-group onChange=this.reorderTiles}}
    as |b|
  >
    <b.row
      @rows={{@data}}
      {{sortable-item model=b.rowValue}}
    >
    </b.row>
  </et.body>
</EmberTable>

Screenshots image In the screenshot above you can see that 1) first has .sortable-item class that was applied initially, no sorting was done, and 2) second was reordered, .sortable-class is missing.

Workaround Manually setting the class="sortable-item" solves the issue