I've got a contenteditable
div that, when empty (only the placeholder text is present per the CSS below), the user is able to click the right-hand side of the div and place the cursor there (see screenshot). Once the cursor is there, the user is unable to type at all. The issue only happens in Firefox (I'm in 33.1.1). The issue does not happen in any other browser.
HTML:
<div class="content-editable form-textarea font-face-frank"
placeholder="Type something here..." contenteditable="true"
ng-model="form.message" ng-class="form.fontName" strip-br="true" required></div>
CSS:
.content-editable {
outline-width: 0;
min-height: 1em;
max-height: 300px;
line-height: 1em;
overflow-y: scroll;
display: inline-block;
width: 100%;
font-size: 44px;
padding: 10px;
}
.content-editable:empty:before {
content: attr(placeholder);
}
What I've Tried:
- Placing a space,
<br>
in the div - fixes issue, but then the placeholder text is not displayed; - Adding a
,<br>
via.content-editable:empty {}
; the placholder text remains, but the cursor issue is not addressed.
Repro of the Issue
Update
Removing the content: attr(placeholder);
css directive resolves the issue, not that doing that allows me to display the 'placeholder' text in the contenteditable element.