fix(clipboard): if unsupported, don't hide element when button is on another target
This commit is contained in:
parent
ab522a3e40
commit
1d4a8795c8
1 changed files with 5 additions and 1 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue