Merge pull request #10024 from colinux/fix-clipboard-blocked

Tech: cache le bouton de c/c lorsque le navigateur bloque l'accès au clipboard
This commit is contained in:
mfo 2024-02-21 14:51:22 +00:00 committed by GitHub
commit b361da97e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,13 @@ export class ClipboardController extends Controller {
#timer?: ReturnType<typeof setTimeout>; #timer?: ReturnType<typeof setTimeout>;
connect(): void {
// some extensions or browsers block clipboard
if (!navigator.clipboard) {
this.element.classList.add('hidden');
}
}
disconnect(): void { disconnect(): void {
clearTimeout(this.#timer); clearTimeout(this.#timer);
} }