Skip to content

Commit

Permalink
fix(bildungsurlaub): Fix copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Agathebadia committed Mar 10, 2024
1 parent c3db248 commit 590fcfb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/routes/home/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ export default class HomeController extends Controller {
return 'An error occurred, please try again';
}

get copyContent() {
// REMINDER: copy to clipboard only works on HTTPS - not locally
async copyContent() {
let text = document.getElementById('copyTextToClipboard').innerHTML;
const copy = async () => {
console.log(text, 'text')
try {
await navigator.clipboard.writeText(text);
alert('Content copied to clipboard');
} catch (err) {
alert.error('Failed to copy: ', err);
alert('Failed to copy: ', err);
}
}
// }
}
}

0 comments on commit 590fcfb

Please sign in to comment.