Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-120594

Source mode in CKEditor may cause editor width to increase



      CKEditor source mode is not properly managing long lines. As a result, a long line will extend the editor window width beyond the original one, up to the width of the longest line.

      This effect is particularly exacerbated in some cases where we preload editor contents with text coming from a predefined template

      Steps to reproduce
      1. Go to Instance Settings → email → Account Created Notification
      2. In the "Body without Password" editor, enable "source" mode

      Note: The case of predefined email templates is particularly misleading as those templates already contain line breaks (<br/>) in the wysiwyg mode, which can be expected to produce corresponding line breaks in source mode. However, parser is not breaking lines upon those tags. <p> tags produce line breaks in source mode. Even if we managed to change how line breaks are produced, it would not be enough as a very long line will produce the reported behavior, as shown in these alternative steps:

      2. In the "Body without Password" editor, make sure "source" mode is not enabled. Delete all text
      3. Write a long, single line, ensure it gets wrapped in the editor
      4. Enable "source" mode

      Observed behavior: editor window witdth grows to acommodate the text
      Expected behavior: editor witdth should not change. Line may be wrapped or just overflow.

      Additional notes to solve this

      • A possible solution to this would be to enable line wrap in source mode.
      • However, please note that it's also possible to let the line overflow, hiding it once it exceeds window width. This behavior can be observed in the CKEditor we use in the Web Content creation/edition page
      • In light of this, I would consider harmonizing this behavior across all ckeditor instances: either wrap lines or let them overflow, or make it configurable in the input-editor tag, so that we have a consistent default behavior which does not alter window width


        Issue Links



              pawel.grabowski Pawel Grabowski (Inactive)
              daniel.sanz Daniel Sanz
              Kiyoshi Lee Kiyoshi Lee
              Julien Castelain Julien Castelain (Inactive)
              0 Vote for this issue
              1 Start watching this issue


                1 year, 47 weeks, 2 days ago


                  Version Package
                  7.3.10 DXP FP1
         DXP SP1
                  7.3.6 CE GA7
                  7.4.13 DXP GA1