I have 2 div's (both draggable). I am doing a drag & drop operation wherein I can swap their positions. Inside the drop operation I am doing an insertBefore for div1 to div2 when dragging div1 & vice versa when dragging div2. Now when I drop div1 over div2 the title of div2 still remains & shows up when drop (dropping div1 on div2) operation completes. And if I move the mouse slightly after drop operation completes then it shows the correct title of div1. Any thoughts why does it still show the title of div2 when drop operation completes even though there is div1 in place of div2? How do I get rid of this?
private source = 1;
private static handleDrop(ev) {
if (this.source === 1) {
this.div1.insertbefore(this.div2);
this.div2.insertBefore(this.splitterDiv);
this.source = 2;
} else {
this.div2.insertbefore(this.div1);
this.div1.insertBefore(this.splitterDiv);
this.source = 1;
}
}