TypeCellOS / TypeCellOS/BlockNote

Caret moves before text inserted with a custom React style

Open
#3,064 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What’s broken?

After inserting text with a custom React style using editor.insertInlineContent(), typing inserts text before the inserted text instead of after it.

What did you expect to happen?

The caret should remain after the inserted text. Typing continued after inserting Styled text should produce Styled text continued, but instead produces continuedStyled text.

Steps to reproduce

Minimal reproduction: https://github.com/ntietje1/blocknote-react-mark-caret-repro

  1. Clone the reproduction and run vp install, then vp run dev.
  2. Click Insert styled text.
  3. Type continued without clicking the editor again.
BlockNote version

@blocknote/core and @blocknote/react 0.54.0.

Environment

Windows, Chromium, React 19.1.1.

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 minimal reproduction and trace the editor.insertInlineContent() entry point when the custom React style is inserted. Verify caret placement by following the reproduction steps; done means typing continued produces Styled text continued without clicking the editor again.

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
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.