When I add the "form-control" class to a contenteditable div, the auto resize feature of the div breaks it seems. Try to add new lines to the div and you will see in the snippet.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="container">
<p>
1st with form-control class
</p>
<div autofocus class="col-md-12 sol-sm-12 form-control" contenteditable="true">Lorem Ipsum Dolor
</div>
<p>
2nd without it
</p>
<div autofocus class="col-md-12 sol-sm-12" contenteditable="true">Lorem Ipsum Dolor
</div>
</div>
The .form-control element is having a height set to 34px by the 'bootstrap.min.css'. You need to override it using,
.container .form-control {
height: auto;
}
CODEPEN
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With