diff --git a/app/javascript/retrospring/controllers/share_controller.ts b/app/javascript/retrospring/controllers/share_controller.ts index c1b5d350..e48daceb 100644 --- a/app/javascript/retrospring/controllers/share_controller.ts +++ b/app/javascript/retrospring/controllers/share_controller.ts @@ -5,12 +5,14 @@ export default class extends Controller { static values = { url: String, text: String, - title: String + title: String, + copyContent: String }; declare readonly urlValue: string; declare readonly textValue: string; declare readonly titleValue: string; + declare readonly copyContentValue: string; share() { let shareConfiguration = {}; @@ -42,4 +44,8 @@ export default class extends Controller { }) .catch(noop); } + + async copyToClipboard(){ + await navigator.clipboard.writeText(this.copyContentValue) + } }