adjust ui

This commit is contained in:
Pete Matsyburka committed 2026-09-23 11:00:18 +03:00
1 parent e11f4bddbe
commit 8f33c8d8b6
14 files changed
+383 -342

No files matched your search

@@ -1,5 +1,7 @@
export default class extends HTMLElement {
connectedCallback () {
this.id = `autoresize-textarea-${Math.random().toString(32).split('.')[1]}`
this.resize()
this.textarea.addEventListener('input', () => this.resize())
+12
View File
@@ -2,6 +2,18 @@ export default class extends HTMLElement {
static observedAttributes = ['class']
connectedCallback () {
this.addEventListener('turbo:morph-element', this.onMorph)
this.trigger()
}
disconnectedCallback () {
this.removeEventListener('turbo:morph-element', this.onMorph)
}
onMorph = (event) => {
if (event.target !== this) return
this.trigger()
}
+5
View File
@@ -9,6 +9,11 @@ export default class extends HTMLElement {
})
document.addEventListener('turbo:before-cache', this.onBeforeCache)
if (this.input.value) {
this.input.focus()
this.input.setSelectionRange(this.input.value.length, this.input.value.length)
}
}
disconnectedCallback () {