fix: disable code block language selector when editor is not editable#2351
Merged
nperez0111 merged 1 commit intoTypeCellOS:mainfrom Jan 27, 2026
Merged
Conversation
When `editable={false}` is set on the BlockNoteView, the language selector
dropdown in code blocks was still interactive. This fix checks
`editor.isEditable` and disables the select element when the editor is
in read-only mode.
Fixes TypeCellOS#2156
|
@ysds is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
matthewlipski
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2156
Disable the language selector dropdown in code blocks when
editable={false}is set on the BlockNoteView.Rationale
As reported in #2156, when the editor is set to read-only mode (
editable={false}), the code block language selector dropdown remains interactive, allowing users to change the language. This is inconsistent with the expected behavior where all editing functionality should be disabled in read-only mode.Changes
editor.isEditablebefore registering the change event listener on the language selectorselect.disabled = truewhen the editor is in read-only modeImpact
editable={true}(default behavior)editable={false}, the language selector will be visually disabled and non-interactiveeditableare properly handled due to Tiptap'ssetEditable()triggering a re-render of block componentsTesting
editable={false}set on BlockNoteView - language selector is disablededitable- selector state updates correctly when toggling between editable and read-only modesScreenshots/Video
N/A
Checklist
Additional Notes