When using Drag Panel Extender for a panel that exists inside an absolutely positioned element, the Drag Drop Manager calculates an incorrect starting point !! The problem appears for browsers other than IE.
Steps to produce the issue:
Open AjaxToolkit SampleWebSite/DragPanel/DragPanel.aspx and set the div with class named "demoarea" to use absolute position, test the page in a browser other than IE to get an instance of GenericDragDropManager created.
Solution:
By looking at DropDropScripts.js I found the following:
1. startDragDrop function inside AjaxControlToolkit.IEDragDropManager.prototype tracks original position of drag visual then set it to "absolute":
dragVisual.originalPosition = dragVisual.style.position;
dragVisual.style.position = "absolute";
2. Then there is a check condition if the drag visual position is absolute:
if (dragVisual.style.position == "absolute") // this will always execute, because it was explicitly set above.
changing this to:
if (dragVisual.style.originalPosition == "absolute") //will fix the issue because it will execute only if drag visual actually has an absolute position.
Best regards,
Mohammad K. Younes.
Comments: Issue closed after 6 YEARS ... Impressing!!
Steps to produce the issue:
Open AjaxToolkit SampleWebSite/DragPanel/DragPanel.aspx and set the div with class named "demoarea" to use absolute position, test the page in a browser other than IE to get an instance of GenericDragDropManager created.
Solution:
By looking at DropDropScripts.js I found the following:
1. startDragDrop function inside AjaxControlToolkit.IEDragDropManager.prototype tracks original position of drag visual then set it to "absolute":
dragVisual.originalPosition = dragVisual.style.position;
dragVisual.style.position = "absolute";
2. Then there is a check condition if the drag visual position is absolute:
if (dragVisual.style.position == "absolute") // this will always execute, because it was explicitly set above.
changing this to:
if (dragVisual.style.originalPosition == "absolute") //will fix the issue because it will execute only if drag visual actually has an absolute position.
Best regards,
Mohammad K. Younes.
Comments: Issue closed after 6 YEARS ... Impressing!!