79263373

Date: 2024-12-08 21:27:29
Score: 1.5
Natty:
Report link

In css-tricks they have this article about auto-growing inputs:
https://css-tricks.com/auto-growing-inputs-textareas/

The one i like has just a line of JS. I know you said 0 JS, but you dont have many options i think, and it's nothing to complicated.

label {
  display: inline-grid;
}

label::after {
  content: attr(data-value) ' ';
  visibility: hidden;
  white-space: pre-wrap;
}
<label>
  <input type="text" name="" value="" oninput="this.parentNode.dataset.value = this.value" size="1">
</label>

Reasons:
  • Blacklisted phrase (1): this article
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Eloi