mirror of https://github.com/docusealco/docuseal
parent
50e9222216
commit
e55b5b47cd
@ -0,0 +1,17 @@
|
||||
export default class extends HTMLElement {
|
||||
connectedCallback () {
|
||||
this.resize()
|
||||
|
||||
this.textarea.addEventListener('input', () => this.resize())
|
||||
}
|
||||
|
||||
resize () {
|
||||
if (this.textarea.clientHeight < this.textarea.scrollHeight) {
|
||||
this.textarea.style.height = `${this.textarea.scrollHeight}px`
|
||||
}
|
||||
}
|
||||
|
||||
get textarea () {
|
||||
return this.querySelector('textarea')
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue