adopted-ember-addons / ember-sortable

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

Can't use `drag` test helper when using a handle attribute #226

Open kdamball opened 5 years ago

kdamball commented 5 years ago

Without using a handle prop for {{#sortable-item}}, one can easily use the drag test helper. However, without a handle prop - you can't use inputs as per https://github.com/heroku/ember-sortable/issues/124. In other words, impossible to run acceptance tests in this scenario.

kdamball commented 5 years ago

I managed to reproduce it here: https://ember-twiddle.com/78875ceb8f9ea82e63026ec71727d6d6?openFiles=tests.acceptance.my-acceptance-test.js%2C

Change the test to use drag('mouse', '.sortable-item:first-child', () => ({dx: 0, dy: 30})); after removing the handle prop inside {{#sortable-item}} - it will now pass. 🤷‍♂️

jgwhite commented 5 years ago

Thanks for the report and the awesome reproduction.

There seem to be a couple of things at work:

Could you try the latest release (1.12.4)?

I was able to get the twiddle passing by bumping ember-sortable to 1.12.4 and adding the following CSS:

.sortable-item {
  transition: none;
}

The fact that an unspecified transition leads to an incomplete sort is a larger problem, but one we can tackle separately.

kdamball commented 5 years ago

CSS transitions leading to elements not being sorted is probably the bigger issue here 😅

I can't bump it to 1.12.4 because I think it needs ember-cli-babel > 5.5 (which is what I have) but I verified that it works on the twiddle.