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

firstItemPosition computed property is not recomputed when sortedItems changes #600

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gwak
Copy link

@gwak gwak commented Nov 29, 2024

This PR proposes a fix for the test case highlighted in the PR #599.

The changes removes the computed property on the firstItemPosition getter in sortable-group.ts modifier as it's not recomputed when the sortedItems array changes from the outside. If excessive recomputation of that getter gets expensive we could maybe use the more modern @cached decorator from @glimmer/tracking ?

Copy link

netlify bot commented Nov 29, 2024

Deploy Preview for ember-sortable canceled.

Name Link
🔨 Latest commit a144bb3
🔍 Latest deploy log https://app.netlify.com/sites/ember-sortable/deploys/67c865a194f0040007a5f9b4

@gwak
Copy link
Author

gwak commented Feb 17, 2025

Hi @cyril-sf, can any maintainer look into this issue and related PR ? We're currently using our fork in our main production application, but would prefer not to...

@NullVoxPopuli
Copy link
Contributor

I'd feel more comfortable if this PR provided a test that failed before the changes here, and then passes afterwards <3

@NullVoxPopuli
Copy link
Contributor

The changes to the test app feel a smidge excessive? Why'd every example have to change? Can something more targeted happen instead?

@NullVoxPopuli
Copy link
Contributor

Also, biggest apologies for not commenting sooner. I don't know how i missed this PR <3

@gwak gwak force-pushed the fix/non-refreshed-computed-property branch from 3160b76 to 27a34c7 Compare March 5, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants