Coder Social home page Coder Social logo

Comments (5)

taye avatar taye commented on May 15, 2024

Thanks for the request!

dragmove events for dropzones would be useful. The events would need a different name so that dropzones which are also draggables don't think that they're being dragged when something else is being dragged over them. How about "dropmove"? ¯(°_o)/¯

I think that having an event object like this would be good:

{
  target: dropzoneElement,
  dragmove: dragmoveEvent,
  type: 'dropmove'
}

from interact.js.

Izhaki avatar Izhaki commented on May 15, 2024

Yep, dropmove distinction is obviously a must.

Whatever the event object's like, I envision this will be how you use it:

interact('.dropzone')
    // enable draggables to be dropped into this
    .dropzone(true)
    // listen for drop related events
    .on('dropmove', function (event) {
        // Do something here
    });

Just as a final note, I assume dropmove events will only be fired between the dropzone's dragEnter and dragLeave events.

from interact.js.

taye avatar taye commented on May 15, 2024

I've added the dropmove event in #71. Please try it and let me know how it goes.

https://raw.githubusercontent.com/taye/interact.js/dropmove-event/interact.js

from interact.js.

Izhaki avatar Izhaki commented on May 15, 2024

Thanks for implementing this so quickly; all seem to be working.

Just one comment... having looked at setOnEvents it seems that currently the following syntax isn't supported:

        interact( element[0] ).dropzone({
            dropmove:  ctrl.onDropMove,
            drop:      ctrl.onDrop
        });

Although not a big deal, perhaps this is something worth adding.

from interact.js.

taye avatar taye commented on May 15, 2024

Thanks for mentioning that. It should be fixed now.

from interact.js.

Related Issues (20)

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.