Return to homepage
01/01. Alpine.js Auto Textarea Height

Comments

Mark

Handy tutorial, I've come across clients requesting this a few times, but none since I've been using Alpine JS all the time.

I quickly created an Alpine JS plugin after watching this, hopefully it can help others in the future - https://github.com/markmead/alpinejs-textarea-autogrow

  • 0
Ondřej

I found a little problem if you using livewire and content get update x-init will not run and textarea will be not resized. My solution is place in code this script:

and in textarea place this: @textarea-resize.window="resize()"

Im not sure if its best solution but maybe help.

  • 0