taye / interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)
http://interactjs.io/
MIT License
12.32k stars 783 forks source link

[Question Not Issue] how to make a div not draggable based on an input inside it #985

Closed ghost closed 1 year ago

ghost commented 1 year ago

hello nice project I used to create a sticky note section in my app but I had a problem the note is draggable and I have a text area inside this note so I want to make the div (note) not draggable when the text area is shown

any idea ?

ghost commented 1 year ago

well I was tired yesterday but the solution that I did is :

put the interact(target) in a variable

if(editable){ interactTarget = interact.draggable(false) }else{ interractTarget= interact.draggable({}) }