Clean up dead code

This commit is contained in:
2026-06-23 06:55:20 +02:00
parent eb45539ad4
commit 2a84fa58c3
2 changed files with 3 additions and 14 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tp/tp-button", "name": "@tp/tp-button",
"version": "1.3.3", "version": "1.3.4",
"description": "", "description": "",
"main": "tp-button.js", "main": "tp-button.js",
"scripts": { "scripts": {
+2 -13
View File
@@ -225,7 +225,6 @@ class TpButton extends EventHelpers(LitElement) {
this.listen(this, 'click', '_submitOnTap'); this.listen(this, 'click', '_submitOnTap');
this.listen(this._form, 'submit', '_onFormSubmit'); this.listen(this._form, 'submit', '_onFormSubmit');
this.listen(this._form, 'invalid', '_onFormFailed'); this.listen(this._form, 'invalid', '_onFormFailed');
this.listen(this._form, 'response', '_onFormSuccess');
} }
} }
} }
@@ -344,7 +343,7 @@ class TpButton extends EventHelpers(LitElement) {
} }
_submitOnTap() { _submitOnTap() {
if (this.submit && !this.isSubmitting) { if (this.submit && !this.locked) {
this._form.submitButton = this; this._form.submitButton = this;
this._form.submit(); this._form.submit();
} }
@@ -356,14 +355,6 @@ class TpButton extends EventHelpers(LitElement) {
} }
} }
_onFormSuccess() {
this.isSubmitting(false);
if (this.reactive) {
this.showSuccess();
}
}
_onFormFailed(e) { _onFormFailed(e) {
// Only react if this button instance was the actual pressed button. // 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. // 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) { if (this.reactive) {
this.showError(); this.hideSpinner();
} }
} }
} }