craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

Content fields don't update in Live preview when editing "Current" version, using custom preview target #10328

Open michaelrog opened 2 years ago

michaelrog commented 2 years ago

I've noticed a phenomenon where field values don't live-update in Live Preview when I'm editing the "Current" version (prior to an auto-save).

Here's my setup:

And here's the weirdness:

  1. Load entry edit page — version dropdown shows "Current" — and launch Live Preview.
  2. Edit some field values. Dumped element data in template shows previewing => true but field values are not live-updating. (_canonicalId and _canonical are both null.)
  3. Reload entry edit page without explicitly Saving — version dropdown shows "Current - Edited" — and launch Live Preview.
  4. Edit some field values. Now the custom field values are live-updating. (_canonicalId and _canonical now have values, too.)

brandonkelly commented 2 years ago

Are you seeing any JavaScript errors?

michaelrog commented 2 years ago

No errors, but a couple warnings that might be relevant...?

Couldn’t save draft: Form already being submitted. (DraftEditor.js:771:26)

Some cookies are misusing the “SameSite“ attribute, so it won’t work as expected 
brandonkelly commented 2 years ago

Try editing an entry with the Network tab open. When you start making changes, is there an Ajax request that isn’t resolving?

michaelrog commented 2 years ago

Try editing an entry with the Network tab open. When you start making changes, is there an Ajax request that isn’t resolving?

Network activity looks normal; No unresolved requests.

brandonkelly commented 2 years ago

Wonder if this is the same bug as #10257. Can you try updating craftcms/cms to dev-develop as 3.7.28 and see if the issue persists?

michaelrog commented 2 years ago

Wonder if this is the same bug as #10257. Can you try updating craftcms/cms to dev-develop as 3.7.28 and see if the issue persists?

Doesn't seem to solve this one, I'm afraid...

brandonkelly commented 2 years ago

Can you send your project files into support@craftcms.com? (Database, Composer files, templates, config/routes.php, and any custom plugins/modules you’ve got.)

michaelrog commented 2 years ago

Can you send your project files into support@craftcms.com? (Database, Composer files, templates, config/routes.php, and any custom plugins/modules you’ve got.)

yessir, will try to package up a minimal reproduction for you. 👍