13 lines
271 B
JavaScript
13 lines
271 B
JavaScript
import { Controller } from '@hotwired/stimulus'
|
|
|
|
export default class extends Controller {
|
|
connect() {
|
|
this.element.style.height = 'auto'
|
|
this.resize()
|
|
}
|
|
|
|
resize() {
|
|
this.element.style.height = `${this.element.scrollHeight}px`
|
|
}
|
|
}
|