diff --git a/package.json b/package.json index f9b0435..31c5e4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-button", - "version": "1.3.3", + "version": "1.3.4", "description": "", "main": "tp-button.js", "scripts": { diff --git a/tp-button.js b/tp-button.js index 744ba4e..fe75565 100644 --- a/tp-button.js +++ b/tp-button.js @@ -225,7 +225,6 @@ class TpButton extends EventHelpers(LitElement) { this.listen(this, 'click', '_submitOnTap'); this.listen(this._form, 'submit', '_onFormSubmit'); this.listen(this._form, 'invalid', '_onFormFailed'); - this.listen(this._form, 'response', '_onFormSuccess'); } } } @@ -344,7 +343,7 @@ class TpButton extends EventHelpers(LitElement) { } _submitOnTap() { - if (this.submit && !this.isSubmitting) { + if (this.submit && !this.locked) { this._form.submitButton = this; this._form.submit(); } @@ -356,14 +355,6 @@ class TpButton extends EventHelpers(LitElement) { } } - _onFormSuccess() { - this.isSubmitting(false); - - if (this.reactive) { - this.showSuccess(); - } - } - _onFormFailed(e) { // Only react if this button instance was the actual pressed button. // We have to check this in case the parent form has multiple submit buttons. @@ -374,10 +365,8 @@ class TpButton extends EventHelpers(LitElement) { } } - this.isSubmitting = false; - if (this.reactive) { - this.showError(); + this.hideSpinner(); } } }