fix(clipboard): if unsupported, don't hide element when button is on another target

This commit is contained in:
Colin Darie 2024-06-10 14:28:50 +02:00
parent ab522a3e40
commit 1d4a8795c8
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

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