sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Can't click on overlay for edit till I click edit button off and back on.

Open alexander-digett opened this issue 1 year ago • 3 comments

I'm noticing that when I click on "Presentation" I can't click on elements to open up their document and edit until I click the "Edit" button top left off and back on. Is this by design? Screen Shot 2024-02-02 at 1 51 47 PM

alexander-digett avatar Feb 02 '24 18:02 alexander-digett

HI @alexander-digett thanks for the report. Could you please let us know which version of sanity you are using?

pedrobonamin avatar Feb 07 '24 10:02 pedrobonamin

@pedrobonamin I'm experiencing the same issue in my Next.js project. Please see the versions used below.

"dependencies": {
    "@sanity/client": "^6.15.7",
    "@sanity/overlays": "^2.3.30",
    "@sanity/react-loader": "^1.9.5",
    "@sanity/vision": "^3.34.0",
    "next": "^14.1.0",
    "next-sanity": "^8.5.0",
    "react": "^18",
    "react-dom": "^18",
    "sanity": "^3.34.0",
  },

samalexander avatar Mar 22 '24 17:03 samalexander

Hey @alexander-digett! 👋

In order for visual editing to work, the data you fetch from Sanity API should come with additional information encoded into the fields of your content. Read more about Stega-encoding here.

It could be that the initial render does not place Stega-encoded symbols into your DOM tree, which is why visual editing did not work for you until you toggled it on and off. By that time, new data was fetched client-side with Stega-encoded metadata.

In order to make this work, please check you server-side Sanity client configuration and make sure it's configured to use Stega (i.e. stega: true). That should fetch data from Sanity API with content source maps during the initial server-side render.

I hope this helps you!

azaxarov avatar May 22 '24 12:05 azaxarov