Sha256: 39a0a7c76bd9b52f6717be62fa382dbf7de14095f8eb3b7d617fa6bb40fb026e

Contents?: true

Size: 409 Bytes

Versions: 5

Compression:

Stored size: 409 Bytes

Contents

import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
  static get targets() {
    return ["password", "submit"];
  }

  connect() {
    this.password = this.passwordTarget.value;
    this.syncState();
  }

  updatePassword(e) {
    this.password = e.target.value;
    this.syncState();
  }

  syncState() {
    this.submitTarget.disabled = !this.password?.length;
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
masks-0.4.0 app/assets/javascripts/controllers/recover_password_controller.js
masks-0.3.2 app/assets/javascripts/controllers/recover_password_controller.js
masks-0.3.1 app/assets/javascripts/controllers/recover_password_controller.js
masks-0.3.0 app/assets/javascripts/controllers/recover_password_controller.js
masks-0.2.0 app/assets/javascripts/controllers/recover_password_controller.js