-
-
Notifications
You must be signed in to change notification settings - Fork 365
Description
Describe the bug
The "Copy as Markdown" button in the README section header silently fails and nothing is copied to the clipboard. Confirmed in Safari.
Root cause:
copyReadmeHandler() does await fetchReadmeMarkdown() before calling useClipboard's copy(). Safari requires navigator.clipboard.writeText() to be called synchronously within a user gesture. The async fetch breaks that chain, so Safari silently rejects the write.
Code block copy buttons work fine because they call copy() synchronously in the click handler.
Steps to reproduce:
- Open any package page with a README (e.g.
/package/vue) - Click the "Copy as Markdown" button (markdown icon) in the README header
- Paste — nothing was copied
Expected: README markdown content is copied to the clipboard.
Suggested fix:
Fall back to document.execCommand('copy') via a hidden textarea when navigator.clipboard.writeText() fails after the async fetch.
I'm not a Vue expert, so I didn't want to just submit an agent-generated pull request for a framework I'm not super familiar with.