Opened 11 years ago

Closed 11 years ago

#9698 closed Bug (fixed)

content editable inside a main table causes bugs

Reported by: julio Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Cc: rkolomis@…

Description

There is a bug when you have a div with contenteditable="true" inside a main table.

There are many ckeditor functions not working inside these editable block. For example, if you have a structure like this:

<table cellpadding="0" cellspacing="10" border="0">

<tbody>

<tr>

<td width="500px">

<div contenteditable="true">

<p class="texto editable" style="text-align: justify;">

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lectus eros, egestas ut fringilla a, adipiscing ac diam. Vestibulum odio risus, dignissim eu consequat quis, ullamcorper vel est. Donec aliquet lorem ut eros facilisis bibendum imperdiet nisl egestas...

</p>

</div>

</td>

</tr>

</tbody>

</table>

The main problem here is when you SELECT ALL.

Eg.: if you select all and want to delete the selection, THE WHOLE table will be deleted instead of deleting only the <p> content. The same happens with font-family, font-size and font-colors selectors. If you want to apply one of these options none of them will work because the SELECT ALL select the TABLE and not only the text...

Change History (4)

comment:1 Changed 11 years ago by rkolomis

Cc: rkolomis@… added

I wanted to confirm the presence of this bug and add some more details as well. While I have not seen the problem with the CSS declarations on tables, the delete bug is definitely a major issue.

Whether you're selecting all (as described above) or just deleting character by character, if Backspace or Delete is pressed once more after the last character is gone from the inner (editable) element, the whole table will be removed from the DOM. This holds true even if there are other cells within the table with content, and regardless of whether those other cells are also editable. Note that this does not seem to occur with non-tabular elements. Also, this does not affect table sub-elements (tbody, tr, td, etc.) if they are not children of a <table> tag.

-- R

comment:2 Changed 11 years ago by julio

Yes you are right, I just forgot to say that the same happens when you delete character by character. I tried to solve this, intercepting the backspace and delete keycodes and checking the actual content inside the editor, but I´ve not found a good solution yet. Beside this when you select all you cannot set styles to the selection...that´s really annoying.

-- R

comment:3 Changed 11 years ago by rkolomis

As of the first public CKEditor 4 release, this bug seems to have been fixed! The behavior described above no longer occurs and DOM element structure seems to be preserved even when all contents are removed from an editable element.

Many thanks to the devs!

-- R

comment:4 Changed 11 years ago by Piotrek Koszuliński

Resolution: fixed
Status: newclosed

Fixed with #9315 (git:a930e53).

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy