Opened 10 years ago

Closed 7 years ago

#2925 closed Bug (invalid)

Cannot insert a list inside a div container created using the style dropdown

Reported by: tbeatty Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc: Garry Yao, thomas.arp@…

Description

Added the following style to the fckstyles.xml file:

<Style name="Online Content" element="div">

<Attribute name="class" value="pnlOnline" />

</Style>

The pnlOnline style class is defined as follows:

.pnlOnline {

border: dashed 5px Green; margin: 5px; padding: 5px;

}

I create a new div container using the style dropdown box. (See screenshot #1).

If I move the cursor inside the container and add a list (either ordered or unordered), the container is replaced by the list.

If I add some line breaks inside the container and then add a list while the cursor is still inside the container, the list is placed outside the container. (See screenshot #2).

Note: If I create a container using the "Create Div Container" toolbar button, apply my custom style, place the cursor inside the new container, and then create a list, the list is correctly placed inside the container.

I have tested this with Internet Explorer 7, Firefox 3, and Chrome on Windows Vista with FCKEditor 2.6.3 and the latest nightly build as of Feb. 19, 2009.

Attachments (2)

screenshot_1.jpg (101.3 KB) - added by tbeatty 10 years ago.
screenshot_2.jpg (96.3 KB) - added by tbeatty 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by tbeatty

Attachment: screenshot_1.jpg added

Changed 10 years ago by tbeatty

Attachment: screenshot_2.jpg added

comment:1 Changed 10 years ago by Garry Yao

Cc: Garry Yao added

comment:2 Changed 10 years ago by Thomas Arp

Cc: thomas.arp@… added

This is related to #99 and #2403 in that one can not get* the <div class="ss"><p>text</p></div> structure using the xml styles. I realize there might be implications, but a quick solution could be to not remove the para tags if they're there.

*easily - we have non-html-savvy people using the editor.

This bug is confirmed with 2.6.2 and the demo on CKeditor.org.

comment:3 Changed 7 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

For such scenarios you should use Div Container (Create Div Container button) and not insert divs from styles or format combo as the later behave like a text container and not like block container.

  1. When new block-level element, like list, is created it replaces current block level element (in which cursor is placed) holding text.
  2. This is not happening with Div Container because inside this div there is an extra p created for holding text. When new list is created it replaced p inside div and not the div.

I think that name of the button - Create Div Container - suggests that.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy