It seems that both Chrome and Firefox are not following the cols
attribute on textarea
elements within a grid container:
.grid { display: grid; }
textarea:not([cols]) { width: 100%; }
<h2>Not in a grid container:</h2>
<div>
<textarea cols="10" rows="6">some dummy text</textarea>
<textarea>some other text</textarea>
</div>
<h2>In a grid container:</h2>
<div class="grid">
<textarea cols="10" rows="6">some dummy text</textarea>
<textarea>some other text</textarea>
</div>
The rows
attribute is working as expected.
I am looking for a solution where a texarea
respects the cols
when it's placed inside a grid container. If cols
is not defined, it should take up 100% of the available width.