- Issue created by @eucr
- Status changed to Needs work
11 months ago 4:42pm 2 February 2024 This issue needs some work:
- Remove external debounce library and use Drupal one
- Change some event listeners and add more suitable ones
- Determine if current enable/disable automatic preview workflow is the best one
- 🇩🇪Germany a.dmitriiev
Thank you for a nice feature. I still have some suggestions:
- Use Drupal.debounce (core/drupal.debounce library) instead of external jquery debounce library (js/jquery.ba-throttle-debounce.js).
- Try not to use jQuery in the new automatic preview behavior
Drupal.behaviors.autoPreview
. (not critical but we should reduce jQuery usage). - I suggest that "Automatic preview" in frontend editing form is not changing the global config, but just uses pure js to change Drupal settings state and also hides/displays "Preview" button based on its value.
- Listen also to `autocompleclose' event when using entity reference autocomplete fields, check the event for drag and drop inside multivalue field when changing the order
I will also leave the comments in MR
- 🇩🇪Germany a.dmitriiev
I 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 ✨ Trigger event when Text Editor is attached Needs work
Event listeners have been modified. Now this is using
formUpdated
,autocompleteclose
andonDrop
.- 🇩🇪Germany breidert
I 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.
-
a.dmitriiev →
committed 74a106fd on 1.x authored by
eucr →
Issue #3418923: Automatic preview of changes
-
a.dmitriiev →
committed 74a106fd on 1.x authored by
eucr →
- Status changed to Fixed
10 months ago 10:26am 14 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.