I'm using Display flex on a couple DIVs. I'm vertically centring the inner DIV text content. It centres correctly however when i click within the content editable inner DIV while there is no content i can see the caret begins at the top left (for Chrome) or bottom left (for FF). When i begin to type the caret and contents jump to center. As long as there is content the caret is centered fine but when there is no content the caret begins at top (or bottom). What gives?
HTML
<div id="input_area">
<div id="inner" class="content" contenteditable="true" data-hint="Click Here and Type"></div>
</div>
CSS
#input_area
{
background-color: yellow;
display: flex;
overflow-y:auto;
max-height:300px;
min-height:4em;
cursor:auto;
}
#input_area > div.content
{
width: 100%;
display:flex;
align-items:center;
}
#input_area .content[contentEditable=true]:empty:not(:focus):before
{
content: attr(data-hint);
color: #aaaaaa;
}