Opened 16 years ago
Closed 13 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)
Change History (5)
Changed 16 years ago by
Attachment: | screenshot_1.jpg added |
---|
Changed 16 years ago by
Attachment: | screenshot_2.jpg added |
---|
comment:1 Changed 16 years ago by
Cc: | Garry Yao added |
---|
comment:2 Changed 15 years ago by
Cc: | thomas.arp@… added |
---|
comment:3 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
- When new block-level element, like list, is created it replaces current block level element (in which cursor is placed) holding text.
- 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.
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.