Skip to content

Commit 6fe73f2

Browse files
committed
adjust transition to state
1 parent a83379e commit 6fe73f2

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

packages/uui-button/lib/uui-button.element.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,24 @@ export class UUIButtonElement extends LabelMixin('', LitElement) {
5353
--uui-button-padding-right-factor: 1;
5454
}
5555
56+
.label {
57+
display: block;
58+
transition: opacity 120ms;
59+
}
5660
:host([state]:not([state=''])) .label {
57-
visibility: hidden;
61+
opacity: 0;
5862
}
5963
6064
#state {
6165
position: absolute;
6266
transform: translate(-50%, -50%);
6367
top: 50%;
6468
left: 50%;
69+
opacity: 0;
6570
animation-name: fadeIn;
66-
animation-delay: 50ms;
67-
animation-duration: 500ms;
71+
animation-delay: 40ms;
72+
animation-duration: 360ms;
6873
animation-fill-mode: forwards;
69-
opacity: 0;
7074
}
7175
7276
button {
@@ -401,10 +405,10 @@ export class UUIButtonElement extends LabelMixin('', LitElement) {
401405
constructor() {
402406
super();
403407
this._internals = (this as any).attachInternals();
404-
this.addEventListener('click', this.onHostClick);
408+
this.addEventListener('click', this._onHostClick);
405409
}
406410

407-
private onHostClick(e: MouseEvent) {
411+
private _onHostClick(e: MouseEvent) {
408412
if (this.disabled) {
409413
e.preventDefault();
410414
e.stopImmediatePropagation();
@@ -449,7 +453,7 @@ export class UUIButtonElement extends LabelMixin('', LitElement) {
449453
}
450454
}
451455

452-
private renderState() {
456+
protected renderState() {
453457
let element = html``;
454458
switch (this.state) {
455459
case 'waiting':

0 commit comments

Comments
 (0)