sanity
sanity copied to clipboard
Can't click on overlay for edit till I click edit button off and back on.
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?
HI @alexander-digett thanks for the report. Could you please let us know which version of sanity you are using?
@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",
},
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!