TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.

Home Page:https://www.blocknotejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New placeholders option doesn't work with multiple editors

NicHaley opened this issue · comments

Describe the bug
The new placeholders option has a bug where when using more than one editor, the placeholder will be overwritten by the last editor instance.

For additional context on my use-case, I have multiple editors to support a different editing experience between "Title" and "Content" sections of a page (similar to notion).

To Reproduce
Create two editors. Ex.

const titleEditor = useCreateBlockNote({
    placeholders: {
      default: "Untitled",
    },
  });

const contentEditor = useCreateBlockNote();

The placeholder for both will be the default placeholder text.

Expectation: The title editor should have Untitled for its placeholder

Misc

  • Blocknote: 0.12.4

Thanks for reporting, I think you're right. The solution for this would be to add a custom classname to each editor and make the css that's inserted by the placeholder plugin is scoped to the specific editor. Would welcome a PR that solves this!