adopted-ember-addons / ember-sortable

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

Fix error `TypeError: items[0] is undefined` in `sortable-item` modifier #575

Closed mkszepp closed 2 months ago

mkszepp commented 2 months ago

In our app we have seen that when we have only one item we are running into error TypeError: items[0] is undefined this is caused, because the filter returns possible a empty array

The bug was introduced by adding direction grid https://github.com/adopted-ember-addons/ember-sortable/pull/560

Workaround in our app (since this bugfix landes) is to add disabled on group

netlify[bot] commented 2 months ago

Deploy Preview for ember-sortable canceled.

Name Link
Latest commit 5d5826874765ed3b3e1413596a051642e36ba557
Latest deploy log https://app.netlify.com/sites/ember-sortable/deploys/66adee007e4d240008518817
mkszepp commented 2 months ago

@NullVoxPopuli its possible but i think the better way should be to move the addon to TS, so the errors are already visibile while developing :) i'm sure that we find also other errors like this

mkszepp commented 2 months ago

@NullVoxPopuli test added