There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-b9eccb03-ac45-4341-b93f-97e179356be4 XWIKI-22403 Open

WYSIWYG deletes typed text due to fake table selection

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-4b3c5ed1-d15e-48e8-96e1-fe61a94559a4 Marius Dumitru Florea on 11/Sep/24 14:55
 

See https://github.com/ckeditor/ckeditor4/commit/450817e610066ec34b86419e6c60ab71366746ee#r146558349 . In order to clear the fake selection the editor first checks if a table cell is selected. That's not simple because when the table cell was selected CKEditor didn't keep the actual selection around the TD element but instead moved the start / end of the selection inside the table cell. So in order to check if a table cell is selected it needs to check if the entire contents of the cell are selected. To do this it (inefficiently IMO) clones the range contents and checks if their inner text matches the inner text of the cell. The bug is that it doesn't take into account the inner text from all the range contents but only from the first child node... This means that if the cell has multiple paragraphs, it basically compares the content of the first paragraph with the content of the cell and wrongly concludes that the selection doesn't span the full cell...