Skip to content

Commit

Permalink
Disable component before fire any event (vaadin#42)
Browse files Browse the repository at this point in the history
Thanks!
  • Loading branch information
alexberazouski authored and peterblazejewicz committed Dec 5, 2018
1 parent 9d6948a commit a931e12
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vaadin-login.html
Expand Up @@ -87,7 +87,7 @@ <h5>[[i18n.errorMessage.title]]</h5>
</div>
<iron-form id="loginForm" allow-redirect>
<form method="POST" action$="[[action]]">
<vaadin-text-field label="[[i18n.form.username]]" name="username" id="username" autofocus required on-keydown="_handleInputKeydown"></vaadin-text-field>
<vaadin-text-field label="[[i18n.form.username]]" name="username" id="username" required on-keydown="_handleInputKeydown"></vaadin-text-field>
<vaadin-password-field label="[[i18n.form.password]]" name="password" id="password" required on-keydown="_handleInputKeydown"></vaadin-password-field>

<vaadin-button id="submit" theme="primary contained" on-click="submit" disabled$="[[disabled]]">[[i18n.form.submit]]</vaadin-button>
Expand Down Expand Up @@ -133,6 +133,7 @@ <h5>[[i18n.errorMessage.title]]</h5>
}

this.error = false;
this.disabled = true;
if (this.action == null) {
const eventDetails = {
bubbles: true,
Expand All @@ -146,8 +147,6 @@ <h5>[[i18n.errorMessage.title]]</h5>
} else {
this.$.loginForm.submit();
}

this.disabled = true;
}

_forgotPassword() {
Expand Down

0 comments on commit a931e12

Please sign in to comment.