Opened 9 years ago

Closed 9 years ago

#14508 closed Bug (duplicate)

Widget editable region clobbered by Format dropdown when autoParagraph is disabled

Reported by: egli Owned by:
Priority: Normal Milestone:
Component: UI : Widgets Version:
Keywords: Cc:

Description

Because there can be an editable region with no paragraph wrap around contents, format dropdown can have the undesired effect of modifying the editable region element itself, potentially resulting in data loss.

Steps to reproduce

  1. Navigate to https://jsfiddle.net/tm4sjuzq/2/ (a reduced case using a modified simplebox widget)
  2. Move text insertion point into the "Content" editable region
  3. Choose "Heading 1" from the format dropdown

For data loss:

  1. Switch to source mode
  2. Switch back to WYSIWYG

Expected result

All changes are contained within the editable region. The widget template remains intact with an H1 tag contained inside div.simplebox-content.

Actual result

The changes have leaked out to the editable region element itself, with its tag name changed to H1. This is extremely undesirable because:

  1. The editable region selector no longer matches the editable region. If the data is stored and reloaded this element will no longer be editable.
  2. If user goes engages source mode, content of editable region is completely destroyed.

As mentioned in point b, this problem can result in additional data loss if the user toggles source mode. At step 4 we lose the content of the editable region. At step five we also lose the attributes of the editable region tag.

Other details (browser, OS, CKEditor version, installed plugins)

Tested CKEditor versions:

  • 4.5.4
  • 4.5.7

Tested browsers:

  • Chrome 48.0.2564.116 (64-bit) on Linux
  • Safari 9.0.3 (11601.4.4) on Mac OS X 10.11.3

Change History (1)

comment:1 Changed 9 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed
Version: 4.5.7

This is not only related to autoParagraph but also to enter br.

@egli thank you very much for the code (it will be useful), but I will close this ticket as a duplicate of #14529.

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