Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Add automatic preview feature so that when the user is editing, the content is automatically previewed without the need of clicking "Preview" button. This way the user has the ability to enable or disable the automatic preview feature, both from the module settings and the editing form.
Issue fork frontend_editing-3418923
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 #3
eucr CreditAttribution: eucr commentedComment #4
eucr CreditAttribution: eucr at 1xINTERNET commentedThis issue needs some work:
Comment #5
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer and at 1xINTERNET commentedThank you for a nice feature. I still have some suggestions:
Drupal.behaviors.autoPreview
. (not critical but we should reduce jQuery usage).I will also leave the comments in MR
Comment #6
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer and at 1xINTERNET commentedI have worked on some comments from MR. What is left is polishing the detection of changes in the form. What would be nice to have: autocompleteclose, draggable stop and also changes in CKEditor5. For the last one maybe this can be useful https://github.com/ckeditor/ckeditor5/issues/996 and https://www.drupal.org/project/drupal/issues/3319358
Comment #7
eucr CreditAttribution: eucr at 1xINTERNET commentedEvent listeners have been modified. Now this is using
formUpdated
,autocompleteclose
andonDrop
.Comment #8
breidert CreditAttribution: breidert at 1xINTERNET commentedI tested it and found it working nicely.
However, there a small bug: When you drag a media reference field for example in a gallery, the change is detected, but the content is not updated. First after the next change, the previous change is updated.
I think the error handling is ok. For me it is enough, when the message is displaying on top. However, I think we should make it sticky, because sometimes you work on the bottom of the form, and cannot see the message on top. Also you have a layout shift, when the error message appears.
Furthermore, I suggest to not hide the preview button, when automatic preview is enabled. Having the button can help, to trigger a new preview to get the error message away and update the order of items if the preview did not send them correctly.
Comment #10
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer and at 1xINTERNET commented