fix(clipboard): hide clipboard button when clipboard is blocked
This commit is contained in:
parent
5a8859cd28
commit
bda8d66047
1 changed files with 7 additions and 0 deletions
|
@ -14,6 +14,13 @@ export class ClipboardController extends Controller {
|
|||
|
||||
#timer?: ReturnType<typeof setTimeout>;
|
||||
|
||||
connect(): void {
|
||||
// some extensions or browsers block clipboard
|
||||
if (!navigator.clipboard) {
|
||||
this.element.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
disconnect(): void {
|
||||
clearTimeout(this.#timer);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue