-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
drag/drop not resolving promise on drag end #231
Comments
I believe this is relevant to the conversation in this PR #223 (comment) |
Maybe |
It looks like we do check to make sure the element is actually animated. Do you have any custom styles for transitions that you're using? https://github.com/heroku/ember-sortable/blob/master/addon/mixins/sortable-item.js#L129 |
Doesn't look like we are specifying any transition properties on the element. Here's a snapshot from transition: "all 0s ease 0s"
transitionDelay: "0s"
transitionDuration: "0s"
transitionProperty: "all"
transitionTimingFunction: "ease"
|
If I change the implementation of let duration = getComputedStyle(el).transitionDuration;
return duration !== '0s'; Then everything works correctly again. Perhaps the best way to compute |
This logic could certainly be more robust. A PR to that effect would be very welcome. |
Saw this addon promoted on the 31 Days of Ember and thought we would give it a try. On the very first attempt on what I thought would be a simple use, we ran into exactly this problem, but it appears is going on a year and not yet resolved. Not sure how transition:all is being set on our element, assuming that its in a class somewhere, or we use ember-animated and it is adding it. Would sure love this fixed as right now it blocking our ability to use this addon at all. |
@cah-briangantzler thanks for bringing this back to light. Do you mind reproducing your issue via a twiddle? A long term solution would probably involve refactoring the logic to not be solely controlled by the transitionend event. |
Given the solution and comments, I would think any default simple example would show the problem since Had really wanted to use it with Yeti Table, but I see the group is coded to a Thanks for the help. |
Yeah unfortunately, there are still some gaps to be filled in terms of documentation and doing things the "right" way. I haven't had the chance to try the addon with the new fancy glimmer syntax yet. At the moment, the only way to change the Perhaps, I can explore turning the addon into a tagless, but I'm unfamiliar with the backward-compatibility-ness of doing so, so it might be a future task when |
Tagless is not only glimmer, you can do tagless in all version by just saying tagName: "". This does however remove the ability to use the override methods like click. However with modifiers you can replace this behavior. I did not see what the backward compatible target is for this add on. The modifier polyfill goes back to 2.13. Would that be an acceptable limit if I were to do a pull request? |
No objections to any PRs :) |
@ygongdev how about officially supporting ember |
@jgwhite 👍 might also be a good excuse to bring in some of the |
Yea, looking at the polyfills. So here is what Im thinking (Using modifiers)
You could then easily re-write the current components as tagless and put the Now that the modifiers are available you could then do the below which I would love to see working.
If the above syntax would be acceptable, I will start working on a PR and see if i can pull that off. |
@cah-briangantzler the syntax looks promising. Is angle bracket invocation a requirement for modifiers (from just looking at your example). What will it look like with the good old I think it would make sense for us to move this conversation to somewhere else (perhaps new issue). |
The discussion about modifiers has been moved to a #342 |
Describe the bug
Dragging a
sortable-item
and then releasing it does not cause_complete()
to be called.To Reproduce
Steps to reproduce the behavior:
onDragStop
actiononDragStop
action is never calledExpected behavior
onDragStop
action is calledAdditional context
I stepped thru the code and this seems to be the relevant bit:
(from https://github.com/heroku/ember-sortable/blob/master/addon/mixins/sortable-item.js#L665-L668)
That
transitionend
event never fires, so the promise never resolves.As a workaround I was able to manually set
isAnimated=false
on the sortable-item and then it works again, since it uses arun.later
to resolve the promise instead of thetransitionend
event.The text was updated successfully, but these errors were encountered: