refactor, use invalid class

This commit is contained in:
Pete Matsyburka committed 2025-09-06 10:18:01 +03:00
1 parent f7be74eb73
commit 284204fd78
6 files changed
+33 -36

No files matched your search

@@ -1,14 +0,0 @@
export default class extends HTMLElement {
connectedCallback () {
this.input = document.getElementById(this.dataset.inputId)
this.input.addEventListener('input', () => {
if (this.input.value.trim().length > 0) {
this.classList.remove('hidden')
} else {
this.classList.add('hidden')
this.querySelectorAll('input').forEach(input => { input.value = '' })
}
})
}
}