Skip to content

Code block language can be changed even when editable is false #2156

@ysds

Description

@ysds

Describe the bug
When syntax highlighting is enabled for code blocks, users can still change the language via the language selector dropdown, even when the editor's editable property is set to false.

Expected Behavior:
The language selector should be disabled or non-interactive when editable is false.

Actual Behavior:
The language selector remains interactive and allows users to change the language selection.

To Reproduce

https://stackblitz.com/edit/github-rm5p7nzp?file=src%2FApp.tsx

  • enable codeBlock syntax highlighting
  • <BlockNoteView editor={editor} editable={false} />

Misc

  • Node version:
  • Package manager:
  • Browser:
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions