sanity-io / sanity-plugin-iframe-pane

Display any URL in a View Pane, along with helpful buttons to copy the URL, display a mobile size, reload the iframe or open in a new tab
MIT License
46 stars 12 forks source link

Live preview not working after updating content unless manual refresh #102

Open alberttan-ogilvy opened 6 months ago

alberttan-ogilvy commented 6 months ago

Describe the bug

I've been able to embed the iframe pane for preview, in my Next.js app (app router). The issue is that when you add / split right pane when editing a piece of content and have the right pane as the preview and than you start editing your content the live preview is not streaming the changes as i type.

The presentation tool is working fine with live preview and streaming, just this iframe pane plugin.

I have followed the instruction as documented: https://www.sanity.io/plugins/iframe-pane

I need to manually click Reload to see the changes live.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Post'
  2. Click on any content item
  3. Click on 'Split pane right'
  4. On the right pane, click on Preview
  5. On the left pane start making changes to your content (e.g. title)
  6. Notice how the right preview pane is not streaming the changes in the live preview.

Expected behavior

Preview within the iframe pane show be live and streaming the changes as you type when editing your piece of content.

Screen recording

https://www.screencast.com/t/WbRh7rb1d9aw

Which versions of Sanity are you using?

@sanity/cli (global) 3.17.0 (latest: 3.28.0) @sanity/image-url 1.0.2 (up to date) @sanity/overlays 2.3.3 (latest: 2.3.13) @sanity/react-loader 1.7.1 (latest: 1.8.3) @sanity/vision 3.23.4 (latest: 3.28.0) sanity 3.23.4 (latest: 3.28.0)

What operating system are you using?

macOS 14.2.1 (23C71)

Which versions of Node.js / npm are you running?

10.1.0 v20.8.0

danillocastilho commented 6 months ago

Same issue here. I'm assuming the presentation mode is able to send a signal to the useQuery function used in a "Preview Component".

It's important to note that I set up using the structureTool since the deskTool has been deprecated.