Add silent property to skip animation triggering through submit actions.
This commit is contained in:
parent
837b3abeb2
commit
c88aa759ba
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tp/tp-button",
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"description": "",
|
||||
"main": "tp-button.js",
|
||||
"scripts": {
|
||||
|
@ -140,6 +140,7 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
return {
|
||||
submit: { type: Boolean },
|
||||
extended: { type: Boolean },
|
||||
slient: { type: Boolean },
|
||||
locked: { type: Boolean, reflect: true },
|
||||
};
|
||||
}
|
||||
@ -338,13 +339,18 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
}
|
||||
|
||||
_onFormSubmit() {
|
||||
if (!this.slient) {
|
||||
this.showSpinner();
|
||||
}
|
||||
}
|
||||
|
||||
_onFormSuccess() {
|
||||
this.isSubmitting(false);
|
||||
|
||||
if (!this.slient) {
|
||||
this.showSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
_onFormFailed(e) {
|
||||
// Only react if this button instance was the actual pressed button.
|
||||
@ -357,9 +363,12 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
}
|
||||
|
||||
this.isSubmitting = false;
|
||||
|
||||
if (!this.slient) {
|
||||
this.showError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_findSubmitTarget() {
|
||||
let target;
|
||||
|
Loading…
Reference in New Issue
Block a user