Giter Site home page Giter Site logo

bevacqua / dragula Goto Github PK

View Code? Open in Web Editor NEW
21.8K 359.0 2.0K 1.91 MB

:ok_hand: Drag and drop so simple it hurts

Home Page: https://bevacqua.github.io/dragula/

License: MIT License

CSS 4.98% JavaScript 78.41% HTML 16.30% Stylus 0.30%
javascript front-end drag-and-drop vanilla drag-drop dragging component

dragula's Introduction

logo.png

Drag and drop so simple it hurts

Browser support includes every sane browser and IE7+. (Granted you polyfill the functional Array methods in ES5)

Framework support includes vanilla JavaScript, Angular, and React.

Demo

demo.png

Try out the demo!

Inspiration

Have you ever wanted a drag and drop library that just works? That doesn't just depend on bloated frameworks, that has great support? That actually understands where to place the elements when they are dropped? That doesn't need you to do a zillion things to get it to work? Well, so did I!

Features

  • Super easy to set up
  • No bloated dependencies
  • Figures out sort order on its own
  • A shadow where the item would be dropped offers visual feedback
  • Touch events!
  • Seamlessly handles clicks without any configuration

Install

You can get it on npm.

npm install dragula --save

Or a CDN.

<script src='https://cdnjs.cloudflare.com/ajax/libs/dragula/$VERSION/dragula.min.js'></script>

If you're not using either package manager, you can use dragula by downloading the files in the dist folder. We strongly suggest using npm, though.

Including the JavaScript

There's a caveat to dragula. You shouldn't include it in the <head> of your web applications. It's bad practice to place scripts in the <head>, and as such dragula makes no effort to support this use case.

Place dragula in the <body>, instead.

Including the CSS!

There's a few CSS styles you need to incorporate in order for dragula to work as expected.

You can add them by including dist/dragula.css or dist/dragula.min.css in your document. If you're using Stylus, you can include the styles using the directive below.

@import 'node_modules/dragula/dragula'

Usage

Dragula provides the easiest possible API to make drag and drop a breeze in your applications.

dragula(containers?, options?)

By default, dragula will allow the user to drag an element in any of the containers and drop it in any other container in the list. If the element is dropped anywhere that's not one of the containers, the event will be gracefully cancelled according to the revertOnSpill and removeOnSpill options.

Note that dragging is only triggered on left clicks, and only if no meta keys are pressed.

The example below allows the user to drag elements from left into right, and from right into left.

dragula([document.querySelector('#left'), document.querySelector('#right')]);

You can also provide an options object. Here's an overview of the default values.

dragula(containers, {
  isContainer: function (el) {
    return false; // only elements in drake.containers will be taken into account
  },
  moves: function (el, source, handle, sibling) {
    return true; // elements are always draggable by default
  },
  accepts: function (el, target, source, sibling) {
    return true; // elements can be dropped in any of the `containers` by default
  },
  invalid: function (el, handle) {
    return false; // don't prevent any drags from initiating by default
  },
  direction: 'vertical',             // Y axis is considered when determining where an element would be dropped
  copy: false,                       // elements are moved by default, not copied
  copySortSource: false,             // elements in copy-source containers can be reordered
  revertOnSpill: false,              // spilling will put the element back where it was dragged from, if this is true
  removeOnSpill: false,              // spilling will `.remove` the element, if this is true
  mirrorContainer: document.body,    // set the element that gets mirror elements appended
  ignoreInputTextSelection: true,     // allows users to select input text, see details below
  slideFactorX: 0,               // allows users to select the amount of movement on the X axis before it is considered a drag instead of a click
  slideFactorY: 0,               // allows users to select the amount of movement on the Y axis before it is considered a drag instead of a click
});

You can omit the containers argument and add containers dynamically later on.

var drake = dragula({
  copy: true
});
drake.containers.push(container);

You can also set the containers from the options object.

var drake = dragula({ containers: containers });

And you could also not set any arguments, which defaults to a drake without containers and with the default options.

var drake = dragula();

The options are detailed below.

options.containers

Setting this option is effectively the same as passing the containers in the first argument to dragula(containers, options).

options.isContainer

Besides the containers that you pass to dragula, or the containers you dynamically push or unshift from drake.containers, you can also use this method to specify any sort of logic that defines what is a container for this particular drake instance.

The example below dynamically treats all DOM elements with a CSS class of dragula-container as dragula containers for this drake.

var drake = dragula({
  isContainer: function (el) {
    return el.classList.contains('dragula-container');
  }
});

options.moves

You can define a moves method which will be invoked with (el, source, handle, sibling) whenever an element is clicked. If this method returns false, a drag event won't begin, and the event won't be prevented either. The handle element will be the original click target, which comes in handy to test if that element is an expected "drag handle".

options.accepts

You can set accepts to a method with the following signature: (el, target, source, sibling). It'll be called to make sure that an element el, that came from container source, can be dropped on container target before a sibling element. The sibling can be null, which would mean that the element would be placed as the last element in the container. Note that if options.copy is set to true, el will be set to the copy, instead of the originally dragged element.

Also note that the position where a drag starts is always going to be a valid place where to drop the element, even if accepts returned false for all cases.

options.copy

If copy is set to true (or a method that returns true), items will be copied rather than moved. This implies the following differences:

Event Move Copy
drag Element will be concealed from source Nothing happens
drop Element will be moved into target Element will be cloned into target
remove Element will be removed from DOM Nothing happens
cancel Element will stay in source Nothing happens

If a method is passed, it'll be called whenever an element starts being dragged in order to decide whether it should follow copy behavior or not. Consider the following example.

copy: function (el, source) {
  return el.className === 'you-may-copy-us';
}

options.copySortSource

If copy is set to true (or a method that returns true) and copySortSource is true as well, users will be able to sort elements in copy-source containers.

copy: true,
copySortSource: true

options.revertOnSpill

By default, spilling an element outside of any containers will move the element back to the drop position previewed by the feedback shadow. Setting revertOnSpill to true will ensure elements dropped outside of any approved containers are moved back to the source element where the drag event began, rather than stay at the drop position previewed by the feedback shadow.

options.removeOnSpill

By default, spilling an element outside of any containers will move the element back to the drop position previewed by the feedback shadow. Setting removeOnSpill to true will ensure elements dropped outside of any approved containers are removed from the DOM. Note that remove events won't fire if copy is set to true.

options.direction

When an element is dropped onto a container, it'll be placed near the point where the mouse was released. If the direction is 'vertical', the default value, the Y axis will be considered. Otherwise, if the direction is 'horizontal', the X axis will be considered.

options.invalid

You can provide an invalid method with a (el, handle) signature. This method should return true for elements that shouldn't trigger a drag. The handle argument is the element that was clicked, while el is the item that would be dragged. Here's the default implementation, which doesn't prevent any drags.

function invalidTarget (el, handle) {
  return false;
}

Note that invalid will be invoked on the DOM element that was clicked and every parent up to immediate children of a drake container.

As an example, you could set invalid to return false whenever the clicked element (or any of its parents) is an anchor tag.

invalid: function (el, handle) {
  return el.tagName === 'A';
}

options.mirrorContainer

The DOM element where the mirror element displayed while dragging will be appended to. Defaults to document.body.

options.ignoreInputTextSelection

When this option is enabled, if the user clicks on an input element the drag won't start until their mouse pointer exits the input. This translates into the user being able to select text in inputs contained inside draggable elements, and still drag the element by moving their mouse outside of the input -- so you get the best of both worlds.

This option is enabled by default. Turn it off by setting it to false. If its disabled your users won't be able to select text in inputs within dragula containers with their mouse.

API

The dragula method returns a tiny object with a concise API. We'll refer to the API returned by dragula as drake.

drake.containers

This property contains the collection of containers that was passed to dragula when building this drake instance. You can push more containers and splice old containers at will.

drake.dragging

This property will be true whenever an element is being dragged.

drake.start(item)

Enter drag mode without a shadow. This method is most useful when providing complementary keyboard shortcuts to an existing drag and drop solution. Even though a shadow won't be created at first, the user will get one as soon as they click on item and start dragging it around. Note that if they click and drag something else, .end will be called before picking up the new item.

drake.end()

Gracefully end the drag event as if using the last position marked by the preview shadow as the drop target. The proper cancel or drop event will be fired, depending on whether the item was dropped back where it was originally lifted from (which is essentially a no-op that's treated as a cancel event).

drake.cancel(revert)

If an element managed by drake is currently being dragged, this method will gracefully cancel the drag action. You can also pass in revert at the method invocation level, effectively producing the same result as if revertOnSpill was true.

Note that a "cancellation" will result in a cancel event only in the following scenarios.

  • revertOnSpill is true
  • Drop target (as previewed by the feedback shadow) is the source container and the item is dropped in the same position where it was originally dragged from

drake.remove()

If an element managed by drake is currently being dragged, this method will gracefully remove it from the DOM.

drake.on (Events)

The drake is an event emitter. The following events can be tracked using drake.on(type, listener):

Event Name Listener Arguments Event Description
drag el, source el was lifted from source
dragend el Dragging event for el ended with either cancel, remove, or drop
drop el, target, source, sibling el was dropped into target before a sibling element, and originally came from source
cancel el, container, source el was being dragged but it got nowhere and went back into container, its last stable parent; el originally came from source
remove el, container, source el was being dragged but it got nowhere and it was removed from the DOM. Its last stable parent was container, and originally came from source
shadow el, container, source el, the visual aid shadow, was moved into container. May trigger many times as the position of el changes, even within the same container; el originally came from source
over el, container, source el is over container, and originally came from source
out el, container, source el was dragged out of container or dropped, and originally came from source
cloned clone, original, type DOM element original was cloned as clone, of type ('mirror' or 'copy'). Fired for mirror images and when copy: true

drake.canMove(item)

Returns whether the drake instance can accept drags for a DOM element item. This method returns true when all the conditions outlined below are met, and false otherwise.

  • item is a child of one of the specified containers for drake
  • item passes the pertinent invalid checks
  • item passes a moves check

drake.destroy()

Removes all drag and drop events used by dragula to manage drag and drop between the containers. If .destroy is called while an element is being dragged, the drag will be effectively cancelled.

CSS

Dragula uses only four CSS classes. Their purpose is quickly explained below, but you can check dist/dragula.css to see the corresponding CSS rules.

  • gu-unselectable is added to the mirrorContainer element when dragging. You can use it to style the mirrorContainer while something is being dragged.
  • gu-transit is added to the source element when its mirror image is dragged. It just adds opacity to it.
  • gu-mirror is added to the mirror image. It handles fixed positioning and z-index (and removes any prior margins on the element). Note that the mirror image is appended to the mirrorContainer, not to its initial container. Keep that in mind when styling your elements with nested rules, like .list .item { padding: 10px; }.
  • gu-hide is a helper class to apply display: none to an element.

Contributing

See contributing.markdown for details.

Support

We have a dedicated support channel in Slack. See this issue to get an invite. Support requests won't be handled through the repository.

License

MIT

dragula's People

Contributors

adamkdean avatar beatfreaker avatar benib avatar bevacqua avatar charbelrami avatar connorkrammer avatar daleeidd avatar dcantatore avatar debone avatar djhopper01 avatar dougludlow avatar elrumordelaluz avatar foxolot avatar frantz avatar gnujeremie avatar heroiceric avatar jimf avatar luckylooke avatar maralmosayebi avatar marg51 avatar mattpk avatar maxxwyndham avatar mfsousa avatar nathanwalker avatar nickdecorte avatar peterjosling avatar phillipalexander avatar prayagverma avatar sethmcleod avatar tschuy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dragula's Issues

Item missplaced on drag

Something I noticed when trying out the samples on Firefox 39.0a2: http://imgur.com/8YPS2OP
When you drag the second example, the dragged items stay near the previous example. On the screen cap you can't see the mouse cursor, but it is down on the second box.

Tested on IE 11.0.96 and happens the same.

Can't load dragula in <head>

It seems when loading dragula in <head>, the local body variable is null, which causes all kinds of problems. It seems this is due to document.body being null at the time body is defined: https://github.com/bevacqua/dragula/blob/master/dragula.js#L5

To state the obvious -- I know the ideal solution here is "don't put your scripts in <head>", but unfortunately I have a very large codebase that does exactly the opposite 😑... Maybe dragula could support this? I'd be happy to attempt a PR if you're amenable to it.

Here's a demo showing the problem: http://ryanfunduk.com/dragula-test.html
Same page but loading at EOB: http://ryanfunduk.com/dragula-works.html

Thanks for dragula, btw! It's looking like the drag&drop lib of my dreams :)

allow addContainer to take container id

in my use case, i'll be adding containers dynamically to the page, making them part of dragula containers. therefore those will have dynamically created ids.
it would be ideal to be able to pass the id to the drake.addContainer method (addContainer("left2")
I've also tried passing the dom object through jquery, such as addContainer($("#left2")), but i'm getting an error when doing so.
only addContainer(left2) seems to work

Drop not working

The drag work but there is no drop and no interaction with containers.

This is cause by setting .gu-mirror position absolute but if i don't set position absolute the mirror is not following my cursor and is just stick in the bottom left corner.

Codepen : http://codepen.io/anon/pen/yNBVqa

Containers?

This might be a stupid question, but I'm looking at your example code and I can't figure out where you defined the containers (left, right, single, etc)?

Container can't be dragged

Sorry for bothering you again.
I edited your first demo example so that the right container is inside the left one. The drag and drop function works perfectly but the container won't be dragged. The container moves up if I'm dropping items below it but it won't come down again since I can't drag it. Do I have to edit something or maybe this will be in the future release?
I don't have any advance experience in Javascript so I don't really know how your code works.
Thanks for the answer.

drag and drop

I followed the pattern he showed in the gif but it didn't work in google chrome

lot improvements

i gonna add pr with gulpfile with the following tasks:

  1. Minification
  2. Adding banner (info in top of dist files about plugin, author and repo)
  3. Much module systems in dist? (es6, amd, jquery plugin). i offer to rewrite general library to globals format and then to build for different module systems.

may I send such a pr?

Shadow position when revertOnSpill == true

I was playing around with the demo and noticed that setting revertOnSpill to true results in a misleading shadow position. By this I mean that if you move the item down the list so that its shadow goes from, say, the first to the third position, moving the item out of the box leaves the shadow in the third position. This would seem to indicate to a user that letting go would snap it to the third position, when it would really return to the first.

Steps to reproduce, for clarity:

  1. Grab item
  2. Drag so that shadow indicates new position
  3. Move item outside of drop-friendly zone
  4. Note how shadow does not revert to original position

The main issue with this is that a user can't tell the difference between a box where revertOnSpill == true and one where revertOnSpill == false without making a mistake with their drag. There's a chance that it actually moves to the indicated area, but there's also a chance that it returns to the original position -- that's a confusing and potentially harmful experience. Consider the case where a user drags a document over a trash icon, then changes their mind. They attempt to cancel the drag by moving the mouse outside the drop zone, but the item is deleted anyway -- they assumed revertOnSpill was true, when it was actually false.

Direction and item sizes

Hi, this is a super bit of code.

Is it possible to have items of different sizes which can flow left to right across the page? Something like jumbled up words that can be re-arranged in their proper order?

Phil Bolt

Firefox: Incorrect element position while dragging

When I try to drag an element after I have scrolled down any amount, the copy element being dragged is incorrectly positioned.
Screenshots attached
Latest version of FireFox
Tested on Chrome with no issue

Before scrolling
dragula_ff_1

After scrolling
dragula_ff_2

Drag Handles

It would be great if one could specify a css selector for drag handles.

On iOS 8, removeOnSpill is always triggered

When I re-order any element of the 3rd demo ( removeOnSpill ), on Safari 8 and Chrome, the element is removed.
It's correctly re-ordered on desktop Chrome.

dragula

( iPhone 6, iOS 8.1.2 ).

The project is impressive tho ; )

Why use '.js' on bower package?

Very nice lib, but, I'm trying to use it in a rails project, and I'm getting some problems:

  1. I couldn't get how to install it manually, it depends from some libs and this is not very well documented;
  2. I couldn't use rails-assets for it, because the name of it on bower have the dot char, which is an invalid name for a ruby gem. This could be handled on rails-assets gem generator of course, but I don't really know which are the best practices for naming for bower packages.

So, if you could just explain which libs you depend from, to some other people that want to install it manually, it would be very helpful. The second point is optional, but IMHO it would be better a name without dot (PS: why not just 'dragula', since this package name is not in use on bower yet)

IE8 compability Array.isArray

dragula.js line 47, character 7

You use isArray function, but this function supports from IE9.. Array.isArray()

So without polyfills your library don't work in IE less than 9.. And in Readme no info about this issue

"If you move me I'll just come back here..."

It let's me move it so I'm confused. It makes it sound like it should remain in its place in the element, even if I try to drag it to another box.

Poorly worded or not functioning?

Chrome 41 in case that matters.

Container ids with dashes gives an error

Anytime I try to specify a container id with a dash in it (i.e. left-container) for the initial dragula call I get an error. So:

dragula([leftcontainer,rightcontainer]) will work but
dragula([left-container,right-container]) won't

Specifying containers currently seems to take advantage of the automatically defined properties on the Window object - it would be helpful if we could also specify any id so long as it's valid according to the spec.

No mirror element while dragging

When i start dragging an element they are no mirror element that follow the mouse.

My element is just a simple img in a span :

not usable on IE mobile

I have troubles to use your demo on a Windows Phone. It seems default behaviour (e.g. scrolling) of touch events isn't blocked correctly. That makes it unusable.

crossvent.js?

Ok, I am loading in the head, but what is crossvent.js?

I can't even find it on my system, but dragula is dying there in "function addEventEasy"

Color me confused...

custom domain for gh page

I have seen you have set up a GitHub Page. If you are interested in the custom domain dragula.js.org for free you should have a look at JS.ORG. I would appreciate your request.

Different styling while dragging.

Hi there!

Thank you so much for Dragula! It's pretty awesome and works as promised out of the box. I just have one little issue. While dragging the width of the object isn't kept the same. Before dragging it looks like this:
schermafbeelding 2015-05-12 om 16 34 00
While dragging it looks like this:
schermafbeelding 2015-05-12 om 16 34 40
And after dropping it looks just as it should be.

Do you have any idea what the problem could be? If you need a codepen I can probably fix that! ;)
Thanks in advance!

Necessity & Bug[removeOnSpill] (?)

dragcopy

I need the user drag options from white zone to the black (down), I added on the drop event the necessary thing to prevent the user drop from black to white because is not allowed but when i move from right to left in black zone it copies and i need to stop the copy.

I have the following code :

        $(function(){
            dragula([left1, right1,top1],{
                removeOnSpill: true,
                copy:true,
            }).on('drop', function (el, target, source) {

                if(source == left1 && target == top1){
                    alertify.error("Sie können keine Optionen hinzufügen");
                    el.remove();
                    return false;
                }

                if(source == right1 && target == top1){
                    alertify.error("Sie können keine Optionen hinzufügen");
                    el.remove();
                    return false;
                }

                if(source == left1 && target == right1){
                    // I need to remove the origin element from here
                    // removeOriginElement();
                }
            });
        });    

I would really appreciate your help with this, do i need to handle accepts method ?, how ?
And finally , i have the removeOnSpill set to true, and is not working.

Excelent library 👍 and very useful, thanks.

Using class instead of Id?

One night, I'm searching for the latest jquery drag and drop feature and got this from google search. Reading down the readme and then the scare jump appears! Then I decided to check it on day only.

After some testing I realize that it's needed to be an id to be a container. Can we just use class for it so then the container will be more dynamic (I mean add new container or even container inside container)? Or are there workaround for this?

Please provide examples of the use of drake events

Could you add examples on how to use the drake events, i'm thinking for instance at running a function at every time an element is dropped, but couldn't figure out how to do it properly.
This would really help.
Thx in advance

How to get click events?

Hi, thanks for the great lib. I'm creating dynamically a div container with div's inside that I want to drag, but I also want to be able to click on each div to trigger some code. However when I use dragula on my container, it hides the click event, unless I do a CMD + click (on mac). I want to get the click event without user having to press additional keys... Any suggestion? Thank you.

Target element by class

Is it possible to pass class instead of id to target an element ? Something like:

Move me, but you can only drop me in one of these containers.
If you try to drop me somewhere other than these containers, I'll just come back.
You can drop me in the left container, otherwise I'll stay here.

dragula([.left1, .right1]); ??

One more thing, how can i know where dragged element is dropped? Can i see exact tag that element was dropped IN?

Thanks in advance.

Turning it on/off

I need to be able to go into drag mode, and then turn it off.

Is there a way to do that?

The only way I think it could be done is to keep a Drake object around and add/remove containers, is that the way?

How can I set dynamic containers?

I have two Backbone views that are rendering in different placeholders at different time and I want to drag element from one view and drop it into another. Is it possible to do?

Query

Is it possible to drag all the child elements inside a div ?

Can't use font-awesome i tag as handle

I've just discovered this library today, and i really like it.
A couple of issues i'm encountering though, first with the use of a font-awesome styled , either within a span or not, this won't take it as the handle.
it will work ok with an empty span for instance, but as soon as i set the tag inside the span, it stops working.
same thing with the tag also holding the handle class

Invariant Violation when using React.js

When using dragula to drag and drop react element's an error is throw because cloning elements will end up having two elements with same data-reactid attribute.

This is what the log says:

Uncaught Error: Invariant Violation: ReactMount: Two valid but unequal nodes with the same `data-reactid`: .0.0.0.1:$0.0.4.1.0.0.3.0

Adding/removing containers

I was wondering, is it possible to remove and add the containers dynamically currently?
Because it happens in our use cases a lot that we drop or add a container depending on the situation at hand.

If not: as I was looking at the code. I think it can be either done by having an update function in the api that checks if the containers variable which was passed has changed and adds and removes the elements accordingly. Or just have an add and remove function added to the api.

Dropping item in one container but not another

Awesome tool! It's way more intuitive/light than anything else I've tried.

I'm running into a problem, though, that I can't figure out, and seems to be throwing a warning.

I have two containers. I want to be able to copy items from the right to the left, and move them around the left, but not copy from the left to the right.

I tried the following (in Angular, so s is a essentially global object):

var stopDrop;

s.drakeLeftRight = dragula([left, right], {
  revertOnSpill: true,
  copy: true
});

s.drakeLeft = dragula([left], {
  removeOnSpill: true
});

stopDrop = function(container) {
  if (!_.contains(container.classList, 'left')) {
    return s.drakeLeftRight.cancel();
  }
};

s.drakeLeftRight.on('drop', function(el, container, source) {
  return setTimeout((function() {
    return stopDrop(container);
  }), 0);
});

The hope was that the s.drakeLeftRight.cancel() would "cancel" the drop of the item from the left list if it wasn't dropped into the right.

It also throws this in the console:

Uncaught TypeError: Cannot read property 'className' of null

But the actual behavior is currently that the item transfers (not copies) from the left to the right, disappearing from the left. I've also tried giving cancel an argument of the container into which it's being dropped (thinking, partially because of the above error, that the revert argument might refer to the container from which the item should be cancelled).

No dice. Similarly no dice if I use remove(), which takes the item out from both sides.

Any idea how to do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.