-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x]: Live Preview not reflecting unsaved changes made without live preview #16967
Comments
Hi, thanks for getting in touch! Which view mode is this matrix field using? |
Hi @i-just, thanks for the quick reply! The following view mode is used: |
Thanks! I’m unable to reproduce this. In step 8, I see the text from step 6. I recorded a video based on your steps (only using much shorter text). Does it look like what you’re doing when you encounter this error? Screen.Recording.2025-03-28.at.09.40.58.movCould you enable |
Hi @i-just — thanks for your effort in reproducing this. You are following the same steps as me, weird that it's working for you, so it seems to be an issue on our end. I have ruled out the Matrix Field being an issue, since it happens in a regular text field as well. Tried digging a bit deeper and, when changing the content an existing and already filled input field after a hard refresh, the changes are also not reflected in live preview. I also tried re-saving the entry, since it only started happening after the Craft 5 Update. For the Preview Target, we did configure the following: I also can see some warnings on the console which I assume might be related. Those warnings come up when i press the live preview button. I also tried turning on safe mode on staging, which threw some template errors, which in turn prevented me from digging deeper. The previous developers seem to have used At least I can see why hidden template errors might cause proper rendering to fail — I cannot see though why it only affects updating and not initial rendering. |
Thanks for providing further info!
I also see the warnings you see (about the live region and modal object, but they don’t affect the preview capabilities). Would you be able to simplify the template(s) used by the entry that exhibits the issue you described? For example, try to display only the entry title and the field inside the matrix entry (block) you’re changing. |
Hey @i-just — thanks for getting back to me, and sorry for the delay. I’ve started digging deeper into the issue. It looks like the Empty Coalesce plugin is used quite heavily throughout the project. That would explain why enabling So, to rule out other issues, I stripped the template down to the bare minimum and re-tested in
No change, still not working. This was the whole template. I was trying this out locally, when I spotted another weird behavior: Using the Matrix Field, I added a new content module to the page, called "Headline", which is a single text field. I moved it from the end of the content to the beginning of the content and filled it with text. When starting the preview mode, the text field was there — at the bottom of the page, and empty, seemingly just ignoring everything besides the initial placement. When adjusting the Text (not the placement) while in Preview Mode, the placement resets back to the placement being shown in preview mode, but the text is correctly updated. It feels like the entry’s field layout isn’t updating properly, or dirty states aren’t being registered as expected. That said, I do see the expected network requests hitting the Also worth noting: when opening Preview Mode (regardless of whether changes were made), no network requests are fired. Only when closing it — and only if something was edited — do the expected update requests go out. I’m pretty sure this is something on our end rather than Craft itself, but maybe this behavior rings a bell? Any idea where I could dig next? Really appreciate your help! |
@mnlmaier Any chance you can send in your Composer files and a database backup to support@craftcms.com? If so we can try to reproduce using your site, and figure out what’s going on. |
What happened?
Description
This is kind of a weird title, but I am facing the problem that live preview is not properly updating when making changes with live preview closed.
Live Preview itself is working fine when changes are being made while Live Preview is open.
Steps to reproduce
Expected behavior
I guess, I'd expect Live Preview to reflect the current content state I entered, no matter if I saved it or not.
Actual behavior
Some kind of discrepancy, see Steps to Reproduce.
Craft CMS version
Craft Pro 5.6.10.2
PHP version
8.2.28
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
Please note that we are using MatrixExtended — https://plugins.craftcms.com/matrix-extended?craft5
The text was updated successfully, but these errors were encountered: