Hi All,
I am customizing image selection dialog and when I am removing element from DOM located inside body, and after that If I am adding new element then the new element is added to start of body i.e top left corner of CK-Editor.
So I think focus is getting reset to start of editor when element is removed from DOM.
Code Snippet :
//Get old element to delete from DOM
var oldElement = D.cleanImageElement.getParent();
if (oldElement)
{
oldElement.remove();
delete oldElement;
}
//Insert new element
b.insertElement(mainSpanElement);
mainSpanElement.append(D.imageElement);
mainSpanElement.append(captionSpanElement);
After removing element new element is inserted at top left if CK-Editor irrespective of current image location.
Please suggest any solution or pointers to solve this issue.
Thanks,
Faizaan Shaikh