TypeCellOS / TypeCellOS/BlockNote
Headings not available in block type select dropdown when using `createHeadingBlockSpec`
Nobody has claimed this yet.
- 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:
- Open basic BlockNote example: https://www.blocknotejs.org/examples/basic/minimal
- Enter some text and highlight it
- Open the block type dropdown
- Headings are present
Broken behaviour:
- Open configuring default blocks example: https://www.blocknotejs.org/examples/custom-schema/configuring-blocks
- Highlight some text
- Open the block type dropdown
- Headings are not present
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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