Skip to content

Conversation

matthewlipski
Copy link
Collaborator

This PR fixes an issue where getting editor.isEditable in the render function of a vanilla JS block would return true, regardless of if the editor is actually editable.

This is because editor.isEditable is set in a useEffect hook in BlockNoteViewComponent, which updates the value async, and so it can happen after the block has already rendered.

I've changed it so editor.isEditable is also set in BlockNoteViewEditor, before the editor is mounted, ensuring the value is correct before any vanilla blocks are rendered.

Closes #1477

Copy link

vercel bot commented Aug 7, 2025

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

Name Status Preview Updated (UTC)
blocknote ❌ Failed (Inspect) Aug 7, 2025 1:59pm
blocknote-website ❌ Failed (Inspect) Aug 7, 2025 1:59pm

Copy link

pkg-pr-new bot commented Aug 7, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@1925

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@1925

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1925

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@1925

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1925

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@1925

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@1925

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@1925

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@1925

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-email-exporter@1925

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@1925

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@1925

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@1925

commit: ce65975

Copy link
Contributor

@nperez0111 nperez0111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this seems better than what I had come up with

@matthewlipski matthewlipski merged commit bd1e6c2 into main Aug 8, 2025
6 of 8 checks passed
@matthewlipski matthewlipski deleted the vanilla-blocks-editor-editable branch August 8, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editor.IsEditable returns true for custom blocks when editable is set to false

2 participants