Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Conversation

@reppners
Copy link
Contributor

Hi,

I've done some work on the mobile drag and drop polyfill:
timruffles/mobile-drag-drop#44

It aims to implement the HTML5 drag and drop spec as closely as possible, which worked out pretty well.
You can check out the polyfill in combination with your module here:
https://github.com/reppners/angular-drag-and-drop-lists/tree/mobile-polyfill-compatibility
A bower install should pull in the polyfill.

The reason I need an addition in your module is because the browser implementations are doing something different than is written in the spec. If the spec is implemented strictly it requires to handle the dragenter-event. Browsers seem to not require it being handled, but the polyfill does because otherwise the algorithm defined in the spec isn't working.

I think browsers are doing some magic by checking if an event handler did even exist for the event and if none existed they silently allow the drop.

Anyways.. the additions required are small so I hope you don't mind pulling them in to make the polyfill work for everybody using this library, which would result in "official" support for all mobile browsers when using this library.

Cheers

@marceljuenemann
Copy link
Owner

Thanks for the awesome work!

I tried it out on my Android with Chrome. Dragging works, but the elements are always copied instead of moved, hinting that the dropEffect in the dragend event is not set correctly?!

Anyways, after reading the HTML5 spec, your pull request seems reasonable.

@marceljuenemann marceljuenemann added this to the 1.4.0 milestone Aug 20, 2015
@reppners
Copy link
Contributor Author

Thx :)

What example or page did you use?

I tried it out on my Android with Chrome. Dragging works, but the elements are always copied instead of moved, hinting that the dropEffect in the dragend event is not set correctly?!

Because this can happen when you specify a copyMove or any other combination with copy in front. copy is basically the default operation, since in many cases the user agent can decide what shall be the default action.

So the polyfill right now is not able to give the user the option between copy and move when the effectAllowed is set to copyMove or copyLink.

I thought about having a button appear in some corner or close to the drop target that lets you switch between the options but since this is not a primary use case in my project I didn't spend any further time on this.

@marceljuenemann
Copy link
Owner

I used this demo, which should only allows move: http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple

@reppners
Copy link
Contributor Author

It works fine for me, tested on Nexus 7, Android 5.0.2, Chrome 38.0.2125.

Which browser version are you using? Maybe you should do a reinstall of the bower package by re-running bower install or a complete fresh checkout of https://github.com/reppners/angular-drag-and-drop-lists/tree/mobile-polyfill-compatibility

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants