After clicking "Preview", the contents of a grid field are not visible anymore. When you return to the edit view, the grid field is still empty. Saving keeps all changes made before the preview was opened, so it's probably just a UI issue.
It looks like Live Preview also affects Bard. After adding a set and opening Live Preview, all Sets are rendering inline JSON instead of interactive Set components. This persists after Live Preview is closed.

Hi guys, any timeline on this? - This is a show stopper for us in every demo/training.
This one is really hard to work out. We're going to need to wait for Jason to get back from Australia to work it out - so next week at the very earliest unfortunately.
ok. Let's wait for Jason.
Jason's back. ❤

Live preview is still very broken. The content of our Bard fields our custom Preview::render() method receives does not seem to be the live content, but the content of the published revision of an article.
Also, Bard sets seem to go out of sync. We sometimes see sets being inserted at the wrong position, and its fields showing the contents of a different set. Kinda hard to explain, and we couldn't figure out how to reliably reproduce it yet, but there is definitely something wrong.
Here's how to reproduce another reactivity issue:
For us, the linked item will now show up in the Bard set with just its ID rendered, no title, showing as unpublished even though it's published. Clicking on it doesn't even perform a network request.
Our own Relationship fieldtype does some PHP magic, but uses Statamic's RelationshipFieldtype.vue component. Let me know when you can't reproduce the issue.
The content of our Bard fields our custom Preview::render() method receives does not seem to be the live content, but the content of the published revision of an article.
Is it just bard fields doing this, or any fields?
create a new entry from a blueprint with a Bard field that has a set which has a Relationship field
This issue happens with relationship fields outside of Bard fields, too. 👍
I think Jack's first comment about Bard behavior threw me off when I first tried to fix this issue. I went past your initial description regarding Grid.
After clicking "Preview", the contents of a grid field are not visible anymore.
I can't replicate this behavior. What's in the Grid? Do those inner fields behave the same way if they're placed at the top level?
I can't reproduce the original bug either, but that was before your first fix commit. This bug with disappearing content might be fixed by now.
Right now it's the Relationship fields that are bugged.
I believe this is fixed now. Let me know!
What I wrote in https://github.com/statamic/three-cms/issues/433#issuecomment-514175670 still occurs. Our render() method is called with old data, i.e. not the changes made since opening the article. Please reopen. :(
The content of our Bard fields our custom Preview::render() method receives does not seem to be the live content, but the content of the published revision of an article.
Is it just bard fields doing this, or any fields?
Basic text fields are fine at least.
What does your Entry's toLivePreviewResponse method look like?
public function toLivePreviewResponse($request, $extra)
{
$json = $this->toArray();
$json['body'] = $this->get('body'); // toArray() always returns the prosemirror markup of bard fields, get() does the right thing...
$authorized = false;
if (isset($extra['show_paywall'])) {
$authorized = !$extra['show_paywall'];
}
return response(app('preview')->render($json, $authorized));
}
Use $this->getSupplement('body') instead of just get()
Ahaaa! That does the trick, thanks a lot!
So I'm using
public function toLivePreviewResponse($request, $extra)
{
$json = $this->toArray();
foreach ($this->supplements() as $key => $value) {
$json[$key] = $value;
}
$authorized = false;
if (isset($extra['show_paywall'])) {
$authorized = !$extra['show_paywall'];
}
return response(app('preview')->render($json, $authorized));
}
now and that works well, however, it means we still don't get the live data of Bard fields inside Sets in Bard... :D
toArray() will automatically include the supplemented stuff. You don't need to loop over it like that.
I don't really understand why only Bard is wrong. Are you sure it's only Bard?
It's an old fix, let me try if it's obsolete by now...
I guess you're right, works fine without that replacement now. Thanks!