Problem/Motivation

Auto reload of the preview seems to only be triggered when an input field loses focus, but not when a select list changes value or when paragraphs are being reordered using drag and drop (which in background changes values of hidden select elements).

Steps to reproduce

Reorder two paragraphs or change the value of a select element. The preview is not updated.

Command icon 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

DieterHolvoet created an issue. See original summary.

cosmicdreams’s picture

Ah interesting, This is likely because the grabbers are not being targeted by the update logic.

I wonder if we need to figure out a special case here or expand the logic for the selector. I'll try to look at this tonight.

dieterholvoet’s picture

Title: Auto reload is not triggered when reordering paragraphs » Auto reload is not triggered when changing selects
Issue summary: View changes

I checked and every row has a select element containing the paragraph delta. Which made me discover that live reload isn't triggered when changing any select element in the node edit form, so changing the issue title.

dieterholvoet’s picture

Title: Auto reload is not triggered when changing selects » Auto reload is not triggered when changing selects or textareas
Assigned: Unassigned » dieterholvoet

Also not triggered in textareas, I'll fix that here as well.

dieterholvoet’s picture

It currently doesn't seem to be possible to react to tabledrag changes, not even when listening to the select elements carrying the deltas: #2422737: Tabledrag event after dragging elements. I'll create a separate issue to track that problem so we can focus on getting standard selects/textareas to work here.

dieterholvoet’s picture

Status: Active » Needs review
dieterholvoet’s picture

Assigned: dieterholvoet » Unassigned
cosmicdreams’s picture

Thanks for the MR @DieterHolvoet I hope to have time to review it today.

admirlju’s picture

When you say, that the preview should update on textarea. Should it be constantly changing when you are typing inside a CKEditor5? Because with the current committed code reload only happens when CKEditor loses focus.

When using select, it updates immediately when selecting a different option, that part works fine. Since I'm not sure about how CKEditor5 interaction should update the preview, I'm leaving it as needs review for now.

dieterholvoet’s picture

When you say, that the preview should update on textarea. Should it be constantly changing when you are typing inside a CKEditor5? Because with the current committed code reload only happens when CKEditor loses focus.

No, it's still only when losing focus. And not only CKEditor, but any text area.

admirlju’s picture

Thanks for the answer.

Noticed that nested editor elements didn't trigger auto-reload when you clicked outside the editor. Only when you click inside it. For example on Full HTML, if you add a table, fill in the content, and then click anywhere but the editor the preview doesn't update.

Added so it also listens to OnBlur for .ck-editor__nested-editable

cosmicdreams’s picture

I'll review this tonight!

cedricl’s picture

Tested the MR, seems to work. Could this be merged?

cosmicdreams’s picture

Good news! I'll be traveling to Midcamp tomorrow. I'll be meeting with previous contributors of this module and talking up a gameplan for work (leading up to Drupalcon).

I'll put this to top of my list of issues to consider. Stay tuned.

cosmicdreams’s picture

Status: Needs review » Fixed
cosmicdreams’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

cedricl’s picture

Ticket should be reopened. The drag and drop feature for paragraphs still seems to not work. My bad for only reading the title. The auto reload works on changing selects and textareas, so this part is done. But when draging and dropping paragraph the preview doesn't auto reload. And Even when I press the 'preview' button manually it doesn't update. But after updating a random input field it reloads, and also shows the order changes of the paragraphs.

cedricl’s picture

StatusFileSize
new17.48 MB

Added a video for a clearer view of the issue

dieterholvoet’s picture