daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.15k stars 623 forks source link

Control box changing the target on html manipulation #770

Open afnanz7634 opened 2 years ago

afnanz7634 commented 2 years ago

Hello I'm using Vue-moveable on my project package : "vue": "^2.6.14", "vue-moveable": "^2.0.0-beta.40", "vuex": "^3.6.2"

I'm having trouble while changing the objects html position and the target is also getting changes when i set the target i use onClick setTarget = e.target ; the target is getting saved in VueX store; I'm getting the objects from store . the objects are array of objects and i'm just manipulating the array using

Array_move function the control box also changing the target here is a video what is happening

screen-capture (1).webm

what i obeserved is when the target is set the target is set according to it's index in the dom . when i manipulate the objects array to change the position the e.target get the index of dom thus it's changing the controlbox position

daybrush commented 2 years ago

@afnanz7634

maybe i think

Did you set the key to the target? It looks like the key is likely to be an index.

Only the attribute values of the DOM have changed, and the children structure has not changed.