Opened 10 years ago

Closed 10 years ago

#12914 closed Bug (fixed)

Copy/Paste Table broken in DIV based editor

Reported by: Troy Rhinehart Owned by:
Priority: Normal Milestone: CKEditor 4.5.0 Beta
Component: General Version: 4.0 Beta
Keywords: Firefox Cc:

Description

Using CKEditor demos as example, copying and pasting a table works in iframe demo (http://ckeditor.com/demo#standard) but is broken in div demo (http://ckeditor.com/demo#div). Seeing the same issue in our production implementation using version 4.4.6.

Attachments (2)

447.jpg (6.8 KB) - added by Jakub Ś 10 years ago.
major.png (961 bytes) - added by Jakub Ś 10 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by Jakub Ś

Keywords: Firefox added
Status: newconfirmed
Version: 4.0 Beta

Problem can be reproduced on Firefox from CKEditor 4.0 beta.

To reproduce:

  1. Open divarea sample and clear editor contents
  2. Insert default table 3x2
  3. Select all cells with mouse (works when selecting from element’s path)
  4. Press Ctrl+C Ctrl+V

Result: table has more cells in first row.

comment:2 Changed 10 years ago by Piotrek Koszuliński

Kuba, can you check it on the major branch? AFAICS it works fine there. If so, then please set milestone to 4.5.0.

Changed 10 years ago by Jakub Ś

Attachment: 447.jpg added

Changed 10 years ago by Jakub Ś

Attachment: major.png added

comment:3 Changed 10 years ago by Jakub Ś

Unfortunately issue is still there. Behaviour is better but still there. On major one cell is missing.

4.4.7:

major:

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

Milestone: CKEditor 4.5.0

Ok, I forgot that we haven't yet plugged the new methods for getting selected HTML. So now the clipboard contains a set of <td> without the table structure, hence the weird results. And this will be fixed. Although... the result may stil bel unexpected due to the fact that on Firefox this selection consists of 6 ranges and while pasting we're only handling the first one.

Anyway, I'm assigning milestone 4.5.0 so we won't forget to check this case once everything is ready. However, if the result will still be slightly odd we're not going to work on this in 4.5.0, because it's a huge task itself to handle pasting tables into tables.

Last edited 10 years ago by Piotrek Koszuliński (previous) (diff)

comment:5 Changed 10 years ago by Jakub Ś

Perhaps when all cells are selected we could expand selection to whole table? I'm asking about this because when you click on table in element's path and then copy/paste table, it works.

However, if the result will still be slightly odd we're not going to work on this in 4.5.0, because it's a huge task itself to handle pasting tables into tables.

Perhaps we don't need to fix "the whole world" for this ticket but only add extra "if". After all user don't case about specification but the end result.

comment:6 Changed 10 years ago by Piotrek Koszuliński

Resolution: fixed
Status: confirmedclosed

Ok, I checked this again and the result now is as good as we can make it without special table handling on Chrome:

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
	<tbody>
		<tr>
			<td>
			<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
				<tbody>
					<tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
				</tbody>
			</table>
			</td>
		</tr>
	</tbody>
</table>

<p>&nbsp;</p>

And the result is perfect on Firefox:

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
	<tbody>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	</tbody>
</table>

<p>&nbsp;</p>
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