ember-sortable
ember-sortable copied to clipboard
Can't use `drag` test helper when using a handle attribute
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.
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. 🤷♂️
Thanks for the report and the awesome reproduction.
There seem to be a couple of things at work:
- The way we calculate
scale
in the drag helper (recently fixed) - The way we determine whether or not animated transitions are in play (still an open question)
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.
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.