Quill: Placeholder remains after clicking in editor

Created on 23 Dec 2017  路  5Comments  路  Source: quilljs/quill

Per the previous issue #1831 I can verify that ql-blank is not removed after clicking in the editor.

It is removed after the user begins typing, but if consistent with other interfaces (medium) it would disappear after the click.

Is there a way to override the behavior?

Most helpful comment

I have been able to fix with
.ql-editor.ql-blank::before { margin-left: 40px; }

Pretty straightforward, but if you can reproduce, may be a bug.

All 5 comments

You can remove the placeholder on focus:

.ql-editor.ql-blank:focus::before {
  content: '';
}

https://codepen.io/anon/pen/aEBmEp

Okay, thanks @benbro. That works.

The only remaining issue is that the placeholder text is shifted to the left of the contenteditable div

When the text is clicked on the right it works, but when clicked on the left, nothing happens:

div

Is there an easy way to shift the placeholder text to the right? I've tried adding margin and padding to .ql-blank so far, but no effect

Please include all the info requested in the issue template with a reproducible test case.

Thanks for the heads up on issue templates.

Expected Behavior: Placeholder text exists inside .ql-editor div so when user clicks on the text, the cursor appears and placeholder text disappears.
Actual Behavior: Placeholder text is shifted to the left so when the user clicks on the left half of the placeholder text nothing happens.
Steps to Reproduce the Problem: Add placeholder text to a quill instance and click on the left half of the text and/or inspect the ql-blank div. Please let me know if you can't reproduce.
Specifications: I'm using Meteor JS
Importing the quill editor into the template with the script:
<script src="https://cdn.quilljs.com/1.3.4/quill.js"></script>
Importing css in the head tag:
<link rel="stylesheet" href="//cdn.quilljs.com/1.3.4/quill.bubble.css">
Version: 1.3.4
Platform: Mac OS 10.13

I have been able to fix with
.ql-editor.ql-blank::before { margin-left: 40px; }

Pretty straightforward, but if you can reproduce, may be a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaniilVeriga picture DaniilVeriga  路  3Comments

scottfr picture scottfr  路  3Comments

aletorrado picture aletorrado  路  3Comments

eamodio picture eamodio  路  3Comments

Kivylius picture Kivylius  路  3Comments