slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.55k stars 3.38k forks source link

Keep placeholder for empty heading #4122

Open Alvol opened 6 months ago

Alvol commented 6 months ago

After text format changed from normal to heading placeholder is removed from empty editor Creating new issue, since #2968 is not fixed in quill 2.0

Steps for Reproduction

  1. Visit quill playground
  2. Change format from Normal to Heading 1 or Heading 2

Expected behavior: Placeholder should we visible, with heading format applied

Actual behavior: No placeholder

Platforms:

Windows 10, Chrome 124, Firefox 126

Version:

2.0.0

luin commented 6 months ago

Before Quill implements this, you can achieve a similar behavior via pure CSS (Example). You have to tweak the style though e.g. increase the placeholder font size if the current format is heading.

Alvol commented 6 months ago

@luin yes, thanks for you suggestion. I'm just not sure it's good idea for me to write custom definition of empty text, base on quill inner structure. But, of course, as a workaround it should do it.