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

Placeholder text shouldn't dissapear as soon as editor is focused, it should dissappear when the user starts typing #2604

Closed
CamdenSpehl opened this issue Feb 3, 2024 · 2 comments

Comments

@CamdenSpehl
Copy link

The placeholder text goes away when the editor is focused, even if it is still blank. It should behave like other inputs, where the placeholder goes away once the user starts typing and not when they click in the box. Maybe there is a way to do this I haven't found yet, but it makes the editor feel much less nice.

I wanted to do this to make the editor feel much ncier on my app

@etumyan
Copy link

etumyan commented Jun 15, 2024

It seems we can achieve such behavior by overriding some CSS.

For an empty editor only:

.ce-block:first-child .ce-paragraph[data-placeholder]:empty::before {
  opacity: 1 !important;
}

For all paragraphs:

.ce-paragraph[data-placeholder]:empty::before {
  opacity: 1 !important;
}

For other text blocks the solution may be slightly different:

.ce-header[data-placeholder]:empty::before {
  display: block !important;
}

@CamdenSpehl
Copy link
Author

I really appreciate the response. I ended up switching to making my own block editor so I could have it do whatever I wanted, so I didn't get to test this, but I hope it helps someone in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants