Ensure that button returns to its default state

uses the .blur() method to set the icon button back to its unfocused state after the set time
This commit is contained in:
Henry Wilkinson 2023-04-29 17:17:49 -04:00
parent 228e2187e3
commit 1d7518af07

View File

@ -62,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);
}
}