feat: improved textarea autosize handling
This commit is contained in:
@@ -2,11 +2,12 @@ import { Controller } from '@hotwired/stimulus'
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.element.style.height = 'auto'
|
||||
this.element.rows = 1
|
||||
this.resize()
|
||||
}
|
||||
|
||||
resize() {
|
||||
this.element.style.height = 'auto'
|
||||
this.element.style.height = `${this.element.scrollHeight}px`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user