There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-5055ed6e-e19c-44da-b28c-a76a9c542171 XWIKI-23696 Open

The default content is lost and we can't move to the next step after reordering a WYSIWYG editor based field in AWM

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-c4f3609b-3568-4583-a164-f95800a24d39 Marius Dumitru Florea on 06/Nov/25 13:02
 

Regression caused by XWIKI-22034. It seems the fix from XWIKI-22415 wasn't enough because, surprisingly, editor.isDetached() return false when the rich text area is detached. The problem is that when the CKEditor instance is moved (drag & dropped) the iframe used to implement the editing area is detached which destroys the inner document. After the CKEditor is dropped the iframe is reattached and the content is reloaded (async). XWIKI-22034 added a data listener that checks the current selection. The selection is bound to the window, and there's no window if the iframe is detached. So this listener fails if called while the editor is drag & dropped, or soon after the editor is dropped, before the iframe is reloaded. I was expecting editor.isDetached() to take this use case into account, or at least to have editor.getSelection() return null when there's no selection because the editor is detached. Instead, editor.getSelection() throws an exception if the rich text area's iframe is detached. I need to bulletproof my code it seems.