Reputation: 1
text area is not draggable when enter less words or no words
text area is draggable only when enter words exceeds visible text area
css: textarea {overflow: auto;}
It's not working when I add
resize: both;
or with !important
Does anyone know how to fix this?
Upvotes: 0
Views: 638
Reputation: 11
Just do this in HTML without CSS, and it will work -
<textarea type = "text" draggable = "true" cols = "40" rows = "5"></textarea>
Upvotes: 1
Reputation: 453
<style>
.textarea{
resize: none;
}
</style>
<textarea id="textarea" rows="10" cols="50" oninput="change()">Write something here</textarea>
<script>
function change() {
const dom = document.querySelector('#textarea');
if (dom.value.length > 40) {
dom.classList.remove('textarea')
}else{
dom.classList.add('textarea')
}
}
</script>
Upvotes: 0