Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

mkszepp
Copy link
Contributor

@mkszepp mkszepp commented Jul 31, 2024

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 #560

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

Copy link

netlify bot commented Jul 31, 2024

Deploy Preview for ember-sortable canceled.

Name Link
🔨 Latest commit 5d58268
🔍 Latest deploy log https://app.netlify.com/sites/ember-sortable/deploys/66adee007e4d240008518817

@mkszepp mkszepp changed the title Fix error TypeError: items[0] is undefined Fix error TypeError: items[0] is undefined in sortable-itemmodifier Jul 31, 2024
@mkszepp mkszepp changed the title Fix error TypeError: items[0] is undefined in sortable-itemmodifier Fix error TypeError: items[0] is undefined in sortable-item modifier Jul 31, 2024
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to add a test for this?

@mkszepp
Copy link
Contributor Author

mkszepp commented Jul 31, 2024

@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
Copy link
Contributor Author

mkszepp commented Aug 3, 2024

@NullVoxPopuli test added

@NullVoxPopuli NullVoxPopuli merged commit 64ab29c into adopted-ember-addons:master Aug 3, 2024
22 checks passed
@github-actions github-actions bot mentioned this pull request Aug 3, 2024
@mkszepp mkszepp deleted the fix-item-undefined branch August 3, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants