taye / interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

Home Page:http://interactjs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New Snap syntax not working

prajapati-mukesh opened this issue · comments

Expected behavior

I used the snap modifier in the new version 1.10.26 of interact.js, but it's not working. Here's the code snippet:

interact('.draggable').draggable({
  modifiers: [
    interact.modifiers.snap({
      targets: [startPos],
      range: Infinity,
      relativePoints: [{ x: 0.5, y: 0.5 }],
      endOnly: true,
    }),
  ],
 });

https://codepen.io/mg-ghodela/pen/XWGVWJX?editors=0010

Actual behavior

https://codepen.io/mg-ghodela/pen/abMENOr?editors=1010

System configuration

interact.js version : 1.10.26:
Chrome:
Windows:

commented

It's not clear what should or shouldn't happen in the demo