Problem/Motivation
Using a "Text" layout paragraph with a CKEditor and editing the "Source" (HTML) in the CKeditor isn't saved if you don't switch back to the WYIWYG display (click "Source" again).
Changes in the WYSIWYG display are always saved correctly
When creating the paragraph in "Source" display, and saving the paragraph for the first time, the initial HTML content is saved.
So this only happens when editing the paragraph in "Source" display of the CKEditor and saving the paragraph without swichtig back!
This does NOT happen in the node body, only in layout paragraph modals.
Steps to reproduce
See above and see gif attached for demonstration of different scenarios. I have no clue yet, how that can happen!

Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| layout-paragraphs-wysiwyg-ckeditor-source-code-not-saved.gif | 1.53 MB | anybody | |
| layout-paragraphs-wysiwyg-ckeditor-source-code-not-saved1.JPG | 68.43 KB | anybody |
Issue fork layout_paragraphs-3275082
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyComment #3
anybodyComment #5
justin2pin commentedComment #6
justin2pin commentedI think this is actually three bugs in core, two that I just opened as issues:
#3275611: Editing source using the CKEditor Source mode does not fire change event
#3275613: Adding a link to a drupal media item does not trigger CKEditor's change event
I'm still working on tracking down the third in order to clearly describe it. Basically, it looks like standard, non-Ajax form submissions are NOT respecting the "data-editor-value-is-changed" attribute. Even though the bugs listed above are causing that data attribute to be false, non-Ajax form submissions are not correctly resetting the underlying form values before the form data is submitted.
Comment #7
justin2pin commentedMarking duplicate of #3275611: Editing source using the CKEditor Source mode does not fire change event, which has a patch ready for review.
Comment #8
anybodyWhao, thank you so much for finding out the reason so fast @justin2pin!