[5.x]: Live Preview not reflecting unsaved changes made without live preview
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
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
- Place a new content module on a site (in this case, a Text Input inside a Matrix field)
- Type "Headline goes here" in it
- Open Live Preview and notice that the preview renders properly
- While Live Preview is open, change the text to "Headline from Live Preview goes here" and see the changes being reflected just fine
- Close live preview, notice that the Text Input field is updated with the new Text from Live preview
- With Live Preview closed, change the text to "Headline from outside Live Preview goes here"
- Don't save the entry
- Open Live preview and notice that it's still showing the old text without "outside", both in the Text Input Field and also in the rendered preview
- Close the live preview again, notice that the value in the text field still correctly shows the new value
- Save the entry
- Open Live preview again, notice the new text appearing
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in Craft CMS 5.6.10.2 using a new Text Input inside a Matrix field, following the listed steps with Live Preview opened and closed. Trace how unsaved edits made while preview is closed reach Live Preview, then verify that the current unsaved text appears in both the field and rendered preview before saving.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100