Ready for
Android
Ready for
iOS
Expand Textarea
const textarea = document.getElementById('text');

textarea.addEventListener('input', function () {
	this.rows = 1; // Erm...
	this.rows = countRows(this.scrollHeight);
});

function countRows(scrollHeight) {
	return Math.floor(scrollHeight / 20); // 20px = line-height: 1.25rem
}
10%
149 0
Scroll To Top