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.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | Screen Recording 2024-04-23 at 10.37.34.mov | 17.48 MB | cedricl |
Issue fork same_page_preview-3391528
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
cosmicdreams commentedAh 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.
Comment #3
dieterholvoet commentedI 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.
Comment #4
dieterholvoet commentedAlso not triggered in textareas, I'll fix that here as well.
Comment #5
dieterholvoet commentedIt 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.
Comment #7
dieterholvoet commentedComment #8
dieterholvoet commentedComment #9
cosmicdreams commentedThanks for the MR @DieterHolvoet I hope to have time to review it today.
Comment #10
admirlju commentedWhen 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.
Comment #11
dieterholvoet commentedNo, it's still only when losing focus. And not only CKEditor, but any text area.
Comment #12
admirlju commentedThanks 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
OnBlurfor.ck-editor__nested-editableComment #13
cosmicdreams commentedI'll review this tonight!
Comment #14
cedricl commentedTested the MR, seems to work. Could this be merged?
Comment #15
cosmicdreams commentedGood 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.
Comment #17
cosmicdreams commentedComment #18
cosmicdreams commentedComment #20
cedricl commentedTicket 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.
Comment #21
cedricl commentedAdded a video for a clearer view of the issue
Comment #22
dieterholvoet commented@CedricL there's a child issue for that: #3393957: Auto reload is not triggered when changing tabledrag elements.