Sha256: 6cfd046fbdefd73d69778b69019472607ce406a56d8e58155fee769660f2f764
Contents?: true
Size: 391 Bytes
Versions: 5
Compression:
Stored size: 391 Bytes
Contents
import { Controller } from "@hotwired/stimulus"; export default class extends Controller { static get targets() { return ["input", "submit"]; } connect() { this.input = this.inputTarget.value; this.syncState(); } updateInput(e) { this.input = e.target.value; this.syncState(); } syncState() { this.submitTarget.disabled = !this.input?.length; } }
Version data entries
5 entries across 5 versions & 1 rubygems