Skip to content

Commit 9ca79f3

Browse files
committed
Waits 2 seconds before setting uuiButton state to success
1 parent de55e9b commit 9ca79f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ export class UUICopyElement extends LitElement {
122122
await navigator.clipboard
123123
.writeText(this.#valueToCopy)
124124
.then(() => {
125-
button.state = 'success';
125+
//button.state = 'success';
126126
this.dispatchEvent(
127127
new UUICopyEvent(UUICopyEvent.COPIED, {
128128
detail: { text: this.#valueToCopy },
129129
}),
130130
);
131+
setTimeout(() => {
132+
button.state = 'success';
133+
}, 2000);
131134
})
132135
.catch(err => {
133136
button.state = 'failed';

0 commit comments

Comments
 (0)