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:
commit
b361da97e6
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue