Enter Key Breaks Children in Custom Toggleable Blocks

Open
#2,020 2 comments 0 reactions 1 assignee View on GitHub

@matthewlipski is already working on this.

Since Sep 30, 2025.

Assessment

This issue has not been assessed yet.

Description

bug:P2

Describe the bug
When pressing Enter inside a custom toggleable block, the children are broken unexpectedly.

  • If the cursor is on the toggle title, all children should be preserved, but they are not.
  • If the cursor is inside the children, pressing Enter should move the cursor to the next child (if it exists) or create a new default block.

To Reproduce

  1. Open the example: https://www.blocknotejs.org/examples/custom-schema/toggleable-blocks
  2. Place the cursor in the toggle title and press Enter.
  3. Observe that the children are broken.

Misc

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

https://github.com/user-attachments/assets/eb85ca78-7b74-497d-944e-27017ba6f675

Dominant language
TypeScript
Stars
10.2k
Forks
772
Avg merge
3d 11h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TypeCellOS/BlockNote

All issues in TypeCellOS/BlockNote

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.