-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Describe the bug
When a PortableText area has a code type block, and the window is unmounted for whatever reason (switching to another post, or closing the editor pane), Slate throws up an error.
- Changes seem to be saved successfully 👍
- But the error is quite "loud" 😔
To Reproduce
- Go to a post with a
codeblock on it - Make sure the PortableTextEditor is active by clicking on it
- Switch to a different post OR close the editor pane
- See error
Expected behavior
No error should be shown
Screenshots
codeinput-bug.mp4
Which versions of Sanity are you using?
@sanity/cli (global) 4.6.1 (up to date)
@sanity/code-input 6.0.1 (up to date)
@sanity/eslint-config-studio 5.0.2 (up to date)
sanity 4.6.1 (up to date)
What operating system are you using?
macOS 15.6.1
Which versions of Node.js / npm are you running?
Run npm -v && node -v in the terminal and copy-paste the result here.
10.9.2
v22.17.1
Additional context
I tested reverting Sanity back a few versions, and the issue looks like it started since v4.1.0
It seems to be happy on v4.0.1
GitHub reduced reproduction project
I've made a reduced bug repro here if it helps
https://github.com/indeox/sanity-codeinput-bug-repro
Hope this helps track it down. Happy to help in any way possible 🤗