()
| 392 | }); |
| 393 | }; |
| 394 | const fallback = (): void => { |
| 395 | try { |
| 396 | const field = document.createElement('textarea'); |
| 397 | field.value = line; |
| 398 | field.setAttribute('readonly', ''); |
| 399 | field.style.position = 'fixed'; |
| 400 | field.style.opacity = '0'; |
| 401 | document.body.appendChild(field); |
| 402 | field.select(); |
| 403 | const done = document.execCommand('copy'); |
| 404 | document.body.removeChild(field); |
| 405 | if (done) { |
| 406 | setCopied(id); |
| 407 | setCopyFailed(''); |
| 408 | finishCopy(); |
| 409 | return; |
| 410 | } |
| 411 | } catch { |
| 412 | // faellt in die Meldung darunter |
| 413 | } |
| 414 | setCopied(''); |
| 415 | setCopyFailed(id); |
| 416 | finishCopy(); |
| 417 | }; |
| 418 | try { |
| 419 | const clipboard = navigator.clipboard; |
| 420 | if (clipboard !== undefined && typeof clipboard.writeText === 'function') { |
no test coverage detected