Opened 15 years ago

Closed 15 years ago

#3782 closed Bug (fixed)

Removing lists in table cells results in collapsed table cells.

Reported by: Martin Kou Owned by: Martin Kou
Priority: Normal Milestone: CKEditor 3.0
Component: Core : Lists Version: SVN (CKEditor) - OLD
Keywords: Review+ Cc:

Description

To reproduce:

  1. Open replacebyclass.html in Firefox/Safari/Opera.
  2. Create a table.
  3. Put caret to first cell.
  4. Press Insert/Remove Unordered List twice.
  5. Now the table cell cannot be selected in Firefox, or will give you strange caret positions in Safari/Opera.

Attachments (2)

3782.patch (1.4 KB) - added by Martin Kou 15 years ago.
3782_2.patch (2.8 KB) - added by Garry Yao 15 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 15 years ago by Martin Kou

This is caused by lines 340 - 344 in list plugin.js. But I'm not sure what these four lines were originally meant to fix.

comment:2 Changed 15 years ago by Garry Yao

These lines were for the logic of a special case regarding maintaining paragraph after remove list:

// Original Source
line1
<ul>
<li>item</li>
</ul>
<br />

// After arrayTolist, which append br for every line of items->

line1<br />
item<br />
<br />

// After L340 - 344, which figure out the br after item is redundant.
line1<br />
item
<br />

A simple fix I can imagine but not tested is:

var rootParent = groupObj.root.getParent();
newList.listNode.replace( groupObj.root );
rootParent.appendBogus();

}}}

Changed 15 years ago by Martin Kou

Attachment: 3782.patch added

comment:3 Changed 15 years ago by Martin Kou

Keywords: Review? added

Garry's suggestion works, I've just added some safety checks for it.

comment:4 Changed 15 years ago by Garry Yao

Keywords: Review- added; Review? removed

The safety check may not be necessary, even the root is guaranteed to be a block, could you give me an special case for it?

Changed 15 years ago by Garry Yao

Attachment: 3782_2.patch added

comment:5 Changed 15 years ago by Garry Yao

Keywords: Review? added; Review- removed

comment:6 Changed 15 years ago by Martin Kou

Keywords: Review+ added; Review? removed

comment:7 Changed 15 years ago by Martin Kou

Resolution: fixed
Status: newclosed

Fixed with [3903].

Click here for more info about our SVN system.

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