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() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<sl-button
|
<sl-tooltip content=${this.isCopied ? msg("Copied to clipboard!") : msg("Copy")}>
|
||||||
size="small"
|
<sl-icon-button
|
||||||
@click=${this.onClick}
|
size="small"
|
||||||
?disabled=${!this.value && !this.getValue}
|
name=${this.isCopied ? "check-lg" : "files"}
|
||||||
>${this.isCopied ? msg("Copied") : msg("Copy")}</sl-button
|
label=${msg("Copy to clipboard")}
|
||||||
>
|
@click=${this.onClick}
|
||||||
|
?disabled=${!this.value && !this.getValue}
|
||||||
|
></sl-icon-button>
|
||||||
|
</sl-tooltip>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +62,8 @@ export class CopyButton extends LitElement {
|
|||||||
|
|
||||||
this.timeoutId = window.setTimeout(() => {
|
this.timeoutId = window.setTimeout(() => {
|
||||||
this.isCopied = false;
|
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);
|
}, 3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user