Merge pull request #10506 from colinux/fix-clipboad-targets

Bouton copier/coller: améliore support quand le clipboard n'est pas disponible
This commit is contained in:
Colin Darie 2024-06-11 09:59:38 +00:00 committed by GitHub
commit ed3630e621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,9 +17,13 @@ export class ClipboardController extends Controller {
connect(): void {
// some extensions or browsers block clipboard
if (!navigator.clipboard) {
if (this.hasToHideTarget) {
this.toHideTarget.classList.add('hidden');
} else {
this.element.classList.add('hidden');
}
}
}
disconnect(): void {
clearTimeout(this.#timer);