TypeCellOS / TypeCellOS/BlockNote

Headings not available in block type select dropdown when using `createHeadingBlockSpec`

Open
#2,347 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Usually, when highlighting text in a paragraph block, you are able to change the block type to a heading. When using custom heading config using createHeadingBlockSpec, the option to convert to a heading disappears.

To Reproduce
Expected behaviour:

Image

Broken behaviour:

Image

Misc

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

It seems that in the dropdown:

  • The headings all disappear if you specify allowToggleHeadings: true
  • The headings will not be filtered if levels: [1, 2, 3] is specified (i.e. you can convert to heading 6)

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.

Research direction

Start with the configuring default blocks example and compare its block type dropdown with the basic BlockNote example. Read the createHeadingBlockSpec configuration and trace how allowToggleHeadings and levels affect the dropdown. Done means custom heading configurations show the permitted heading options and filter out disallowed levels.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.