Open nelsonic opened 7 years ago
Neat!
Curious about one point, is the idea to make a drag-and-drop file-uploader kind-of-thing? Or, something that's just moving elements around the document, similar to Dragula but for Elm.
Or, you may want both. Extending the first would probably be a matter of having a draggable element listen for when it is within a certain boundary, then firing when the mouse is released. All things that the mouse package will handle, (it even says "Implement drag-and-drop for something" in the Readme.
Here's a few examples which address your second question:
There is an out-of-date package from the community, all of the examples use the pre-0.17 method of using Signals
, see: github.
The "official" example from elm-lang.org/examples. This one uses the Mouse
package and updates an element's position directly by decoding the XY position as left
/top
css properties.
a hand-rolled DnD example from a small Elm/Haskell app.
Using HTML5 "draggable" property, with a tutorial and brief write-up on the pros and cons of this method.
A few more mentioned in this elm-discuss thread, including Elephant Guide.
š WINNER: The best seems to be Elm-Draggable, with a well-documented API and TESTS.
@newswim Thanks for this! To clarify, our original thinking for this was moving elements around a page as you do in Github for example when you move an issue up and down within a milestone
@ZooeyMiller thanks for sharing / reminding us! we're at client office today so unable to watch the live stream. expecting them to record it can't wait to watch the "Building Reorderable UI in Elm" talk! ā¤ļø Hope you have a great day! š
We need to do a "Spike" to investigate and write-up an example of doing Drag-and-Drop in Elm (it will be very useful for the work we are doing next month ... but nice UI/UX learning in any case)
Specifically:
else
written a comprehensive tutorial on doing Drag-and-Drop (that we can link to)?Remember: this is a discovery, documentation & demo exercise and must
include
tests. Share links and updates to this issue so if you are unable to "finish" the work, someoneelse
cancontinue
working on it when you have to get back "client work"...CC: @naazy, @SimonLab, @shouston3, @ivanmauricio, @andrewMacmurray & @gabrielperales (please update this "CC" list with who ever
else
you know is keen on advancing their Elm skills!)