ember-test-helpers icon indicating copy to clipboard operation
ember-test-helpers copied to clipboard

Add drag and drop support

Open JimSchofield opened this issue 4 years ago • 5 comments

I had to write this for one of my projects, and thought it would be helpful to include.

Tries to support the dataTransfer part of the drag, as that seems to be the most important thing with drag events.

I did not model drag events as a MouseEvent because keeping it a basic event is the simplest, however they are truly mouse events so it may be worth putting it under that umbrella in the code in the future.

JimSchofield avatar Oct 11 '21 14:10 JimSchofield

I tried to refactor the event listeners in the test to make sure it works with ember 3.8. I'm not sure how Ember did event listeners before {{on ...}} so I hope that works? 😁

JimSchofield avatar Oct 23 '21 20:10 JimSchofield

@MelSumner @rwjblue wondering if there's time to review this?

JimSchofield avatar Nov 05 '21 18:11 JimSchofield

@JimSchofield hi! do you have some time to resolve the conflicts?

locks avatar Aug 04 '23 15:08 locks

I spent some time today trying to rebase of of master here. I think I fixed the conflicts, but we're getting behavior changes and the tests are failing. I'm noticing that options being passed into fireEvent are missing when the event is called. Specifically, when I mock the DataTransfer object to allow setting and getting values this object seems to disappear after the event is fired. Perhaps this has to do with making fireEvent return a promise? But I have to visit this another time.

JimSchofield avatar Aug 04 '23 18:08 JimSchofield

hello! sorry for not looking at this PR sooner -- would you be willing to rebase?

NullVoxPopuli avatar Aug 20 '24 16:08 NullVoxPopuli