opentofu.org icon indicating copy to clipboard operation
opentofu.org copied to clipboard

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

Open ollevche opened this issue 1 year ago • 5 comments

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

ollevche avatar May 17 '24 14:05 ollevche

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

ghost avatar May 17 '24 14:05 ghost

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.

damianstasik avatar May 17 '24 15:05 damianstasik