Skip to content

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

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

Closed
NicHaley opened this issue Apr 14, 2024 · 2 comments · Fixed by #1376 or #1439
Closed

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

NicHaley opened this issue Apr 14, 2024 · 2 comments · Fixed by #1376 or #1439
Labels
bug Something isn't working prio:mid Medium priority

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!

@matthewlipski matthewlipski added the prio:mid Medium priority label Jun 11, 2024
@asam3
Copy link

asam3 commented Aug 29, 2024

@YousefED
Could you give an example please?

This was referenced Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:mid Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants