BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

fix: `BlockNoteViewEditor` mismatched editable value

Open matthewlipski opened this issue 1 month ago • 2 comments

Summary

When using BlockNoteViewEditor and setting renderEditor={false} in BlockNoteViewComponent, you currently have to pass the same editable prop to both, or it causes issues.

Because it doesn't make sense to need to pass the same editable prop to 2 different components in the first place, this PR removes the prop from BlockNoteViewEditor. Instead, the editable value is passed in through the BlockNoteContext to ensure it's the same between the components.

Rationale

There is currently an issue with the comments sidebar example caused by this mismatch in editable states, as the prop is passed to BlockNoteViewComponent but not BlockNoteViewEditor.

This makes the editor not focusable while the user selected has only comment priviledges and editable is false. That, in turn, prevents the editor from being focusable, meaning the formatting toolbar can't be shown, and so the user can't add comments.

Changes

See above

Impact

Testing

Technically a breaking change since BlockNoteViewEditor no longer supports the editable prop? Shouldn't really matter though.

Screenshots/Video

N/A

Checklist

  • [X] Code follows the project's coding standards.
  • [X] Unit tests covering the new feature have been added.
  • [X] All existing tests pass.
  • [X] The documentation has been updated to reflect the new feature

Additional Notes

matthewlipski avatar Jan 14 '26 19:01 matthewlipski