How to catch element position changes only after pointerup #2014
-
Hello, I am trying to do some action when elements change their position. I try using the event "change:position" but that event is handled on every move of the element when I am dragging, I only want to handle that event when I'm done dragging and the element changes position. I also try using "cell:pointerup" event and check model.changed.position value, but It returns that the position has changed even if I only click the element without moving. Any idea of how to catch if the element changes the position when finishing the dragging? Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If the paper.on({
'element:pointermove': (_, evt) => evt.data.moved = true,
'element:pointerup': (_, evt) => console.log(!!evt.data.moved)
}); |
Beta Was this translation helpful? Give feedback.
If the
pointermove
event was fired, the element was moved on thepointerup
event.