Merge pull request #806 from webrecorder/frontend-update-copy-button
This commit is contained in:
commit
624e7083cf
@ -40,12 +40,15 @@ export class CopyButton extends LitElement {
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<sl-button
|
||||
<sl-tooltip content=${this.isCopied ? msg("Copied to clipboard!") : msg("Copy")}>
|
||||
<sl-icon-button
|
||||
size="small"
|
||||
name=${this.isCopied ? "check-lg" : "files"}
|
||||
label=${msg("Copy to clipboard")}
|
||||
@click=${this.onClick}
|
||||
?disabled=${!this.value && !this.getValue}
|
||||
>${this.isCopied ? msg("Copied") : msg("Copy")}</sl-button
|
||||
>
|
||||
></sl-icon-button>
|
||||
</sl-tooltip>
|
||||
`;
|
||||
}
|
||||
|
||||
@ -59,6 +62,8 @@ export class CopyButton extends LitElement {
|
||||
|
||||
this.timeoutId = window.setTimeout(() => {
|
||||
this.isCopied = false;
|
||||
const button = this.shadowRoot?.querySelector('sl-icon-button');
|
||||
button?.blur(); // Remove focus from the button to set it back to its default state
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user