-
-
Notifications
You must be signed in to change notification settings - Fork 76
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 enhancements #29
Comments
@daniel-r-austin I'm trying to create an example that showcase all the different drag & drop events, but somehow I'm having trouble getting certain events to fire. Could you take a look as you're the "drag & drop expert" here? :) The idea ist that the colored text should be dragged into the colored boxes and the colored boxes should respond positively or negatively when something is dropped over them. |
Ha, thanks for the vote of confidence. I'll try to take a look tonight or tomorrow if I can manage it. FYI I'll be on vacation from July 4 for 5 or so days and will be out of contact. |
I unfortunately have not been able to figure this one out. It seems pretty clear to me that the dragleave event is being fired when you drag over the "Drop here!" text. You can see this more easily by making the width and height of the drop zones much wider; the color change of the text will work inside of the box as long as you're not dragging over the Drop here! text. Another way to see it is to make the on dragleave text color, say, orange. When dragging onto the box, you'll see the color change from the box color then quickly to orange. Here is a stack overflow question that seems related, but I was unable to get the "pointers-events" solution to work at all. If it's still an issue when I return from my trip, I'll take a second look. Hope that helps! |
Oh dear, so the This behavior is annoying because it does not work with our intuition of the I had hoped that I never have to read the HTML 5 drag & drop speficiation, but apparently, if we want to offer a model that is simpler to understand, we have to deal with it. :) (I don't think we should reproduce the HTML semantice because then every user of threepenny will have the same issues with trying to understand drag & drop. This is Haskell-land, after all.) Judging from the drag-and-drop processing model, it appears that we can use the |
…ver the documentation for drag and drop. #29
It turns out that the HTML 5 specification for drag & drop is horrible and that browser implementations do not even conform to the spec. Well, well, who would have thought? In consequence, I have changed the documentation to include warnings on whatever strange behavior I could observe. In the long term, we probably want to build our own drag & drop model. For instance, separate events on whether a drop was accepted or rejected would be nice, etc. However, for a first release, I think the status quo will do. |
We should probably put the drag & drop attributes and events into a single module.
We should also add an example that showcases all the available events and attributes.
Also think about drag data. Ideally, we want to put arbitrary Haskell values there, though that would probably require an FFI construction à la StablePointer. This discussion is probably best left to issue #23, though.
The text was updated successfully, but these errors were encountered: