sanity-io / visual-editing

https://visual-editing-studio.sanity.build
MIT License
37 stars 20 forks source link

fix(visual-editing): prevent always activating elements on registration #2100

Closed rdunk closed 3 weeks ago

rdunk commented 3 weeks ago

It looks like elements are currently activated (i.e. become visible) on registration (i.e. when they are detected in the DOM), even if the controller itself is deactivated (i.e. the Edit button is in the "Off" state). So for example navigating between pages in an app with Edit set to "Off" will result in overlays being rendered.

This PR adds a simple check to prevent that.

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
live-visual-editing-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-astro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-next-with-i18n ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-nuxt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-page-builder-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-remix ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
visual-editing-svelte ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:09am
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **visual-editing-studio** | ⬜️ Skipped ([Inspect](https://vercel.com/sanity-sandbox/visual-editing-studio/Fp7UrhBYXcxqPyXqQhDxEPQhJzPS)) | | | Nov 6, 2024 0:09am |