Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New placeholders option doesn't work with multiple editors #703

Open
NicHaley opened this issue Apr 14, 2024 · 1 comment
Open

New placeholders option doesn't work with multiple editors #703

NicHaley opened this issue Apr 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@NicHaley
Copy link

NicHaley commented Apr 14, 2024

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
@NicHaley NicHaley added the bug Something isn't working label Apr 14, 2024
@YousefED
Copy link
Collaborator

YousefED commented May 1, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants