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: Block drag start while any item is busy & add wait for transition end in test helper drop #562

Conversation

mkszepp
Copy link
Contributor

@mkszepp mkszepp commented Jun 20, 2024

While added direction grid in PR #560 we have discovered, that the waiting for transitionEnd was not correctly. This has some side-effects in tests, when using with a bigger list of item, because the animation spents more time.

This was the reason, why added tests for direction grid were failed.

This PR fix following bugs

  1. dropend and was already called before all transitions of all items was completed
  2. after dropping a item and taking an other one immediately, brings crazy transition effect and sometime also order was not anymore correct
  3. in tests the drop helper hasn't respected transitionEnd, caused by the other two bugs. Fast reordering like in tests are not working with large lists

@@ -108,4 +108,11 @@ export async function drag(mode, itemSelector, offsetFn, callbacks = {}) {
await callbacks.dragend();
await settled();
}

await waitUntil(
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still needed? wouldn't settled state already be bring us to when there is no .is-dropping?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the problem is, that there is no waiting for transitionEnd, for this reason we need to wait... only adding await settled() will not fix the problem 😒

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.

yay improvement!

@NullVoxPopuli NullVoxPopuli merged commit a606bc1 into adopted-ember-addons:master Jun 20, 2024
18 checks passed
@github-actions github-actions bot mentioned this pull request Jun 20, 2024
@mkszepp mkszepp mentioned this pull request Jun 20, 2024
@mkszepp mkszepp deleted the fix-drag-start-and-test-helper branch June 20, 2024 13:51
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