mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
autoresize textarea
This commit is contained in:
1 parent
50e9222216
commit
e55b5b47cd
4 files changed
+29
-5
No files matched your search
@@ -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')
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user