Sanity Studio rich text link URL input closes/flickers when clicked
This is definitely not a stupid question - what you're describing sounds incredibly frustrating, and I want to help you get to the bottom of it!
First, let me be upfront: the specific issue you're experiencing (popover closing when clicking inside the URL field, flickering edit icon) isn't something I can find documented as a known issue in Sanity's official documentation. However, the symptoms you're describing - especially the third-party cookie warnings and websocket errors - point to some likely culprits.
What Could Be Happening
The fact that you're seeing third-party cookie warnings and websocket closing before handshake errors is significant. These suggest that something in your browser environment is interfering with how Sanity Studio communicates with Sanity's backend services. The Studio needs to maintain connections to Sanity's APIs for real-time features and authentication, and restrictive browser settings can break these connections in unexpected ways.
The popover closing immediately when you try to interact with it could be a symptom of these connection issues causing focus/state management problems in the Studio UI.
Things to Try
1. Browser Privacy Settings
Since you mentioned third-party cookies specifically, start here:
- Enable third-party cookies for your Studio domain and
sanity.iodomains - Disable strict tracking protection for your Studio URL (in Firefox: click the shield icon; in Safari: disable "Prevent Cross-Site Tracking" for the site; in Brave: turn off Shields)
- Try Chrome if you're not already using it - Chrome tends to have fewer issues with Sanity Studio than browsers with aggressive privacy defaults like Safari or Firefox
2. Browser Extensions
Ad blockers and privacy extensions can interfere with Studio functionality:
- Test in an incognito/private window with all extensions disabled
- Specifically check for uBlock Origin, Privacy Badger, Ghostery, or similar extensions
- Try a completely fresh browser profile
3. Network Environment
The websocket errors suggest potential network-level blocking:
- Are you behind a corporate firewall, VPN, or proxy? These can block websocket connections
- Try on a different network (like your phone's hotspot) to rule out network restrictions
- Check if your network admin needs to allowlist Sanity's domains
4. Keyboard Navigation Workaround
While troubleshooting, try this alternative approach:
- Select the text you want to link
- Click the link icon
- Instead of clicking in the URL field, press Tab to navigate to it
- Type or paste your URL
- Press Enter to confirm
This sometimes bypasses focus management issues that clicking triggers.
5. Update Sanity Studio
Make sure you're running the latest version:
npm update sanityIf you're on Studio v4, ensure you're using Node.js 20+ as that's a requirement.
6. Clear Cache and Restart
Sometimes corrupted browser state causes UI issues:
- Clear your browser cache for the Studio URL
- Restart your development server (
npm run dev)
Your Schema Is Probably Fine
Since you mentioned that portable text rendering works correctly in your Next.js app, your schema configuration is almost certainly correct. The Block Content structure you've set up is working - this is purely a Studio UI interaction issue, not a configuration problem.
Next Steps If Nothing Works
If you've tried all the above without success:
Check browser console - Open your browser's developer tools (F12) and look at the Console and Network tabs when you try to add a link. Share any error messages you see.
Try the production Studio - If you're developing locally, try accessing your Studio through
yourproject.sanity.studioto see if the issue persists in the hosted environment.Report it - Search Sanity's GitHub issues to see if others have reported similar behavior, or post in the Sanity Slack community with:
- Your browser and version
- Your Sanity Studio version (
npm list sanity) - Any console errors
- Whether it happens in multiple browsers
The fact that it eventually worked on mobile Chrome (even if painfully) strongly suggests this is a browser-specific issue rather than a fundamental problem with your setup. You're not an idiot - you've actually done great troubleshooting by testing across multiple browsers and finding a workaround!
Start with the browser privacy settings and extension checks - those are the most common causes of the symptoms you're describing. Good luck, and I hope you get it sorted!
Show original thread10 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.