opentofu / opentofu.org

The OpenTofu Website
https://opentofu.org/
Apache License 2.0
43 stars 21 forks source link

🐛 [BUG] - Copy button doesn't work in Safari #298

Open ollevche opened 4 months ago

ollevche commented 4 months ago

Description

There is a copy button on code snippets, which should insert the snippet's content into the user's clipboard. It doesn't work properly in Safari (inserts a few spaces).

Reproduction steps

1. Go to 'https://opentofu.org/docs/language/state/encryption/#configuration' in Safari
2. Click on 'Copy button' (right upper corner of the snippet)
3. Try to paste it somewhere

Screenshots

No response

Logs

No response

Browsers

Safari

OS

Mac

ghost commented 4 months ago

@damianstasik I have no Mac, could you please take a look at this?

damianstasik commented 4 months ago

I can reproduce the issue on Safari and it looks like copy-text-to-clipboard package is having some issues there. We could try switching to Clipboard API which has pretty good support and would fix this issue.