playground
This is a simplified version of my problem.
seems like I cannot put a positioned pseudo element inside a contentEditable and yet have the caret positioned in the correct place when clicking to get focus on the contentEditable element.
div{ padding:10px; border:1px solid #CCC; height:120px; position:relative; }
div::before{
position:absolute;
top:10px;
left:10px;
content:"placeholder";
color:#AAA;
transition:.2s;
opacity:0;
}
div:empty::before{
opacity:1;
}
<div contentEditable></div>
UPDATE - FOUND THE REPORTED BUG:
please vote for this bug to be repaired - https://bugzilla.mozilla.org/show_bug.cgi?id=904846