[PR #8357] [MERGED] docs: fix copy button client-side error #24821

Closed
opened 2026-04-15 22:34:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8357
Author: @bytaesu
Created: 3/4/2026
Status: Merged
Merged: 3/5/2026
Merged by: @bytaesu

Base: canaryHead: cursor/docs-copy-button-error-7907


📝 Commits (2)

  • 7b2449c fix(docs): fix Copy MD button error on first click
  • db8b92e Merge branch 'canary' into cursor/docs-copy-button-error-7907

📊 Changes

1 file changed (+21 additions, -10 deletions)

View changed files

📝 landing/app/docs/[[...slug]]/page.client.tsx (+21 -10)

📄 Description

Fix client-side error on first click of "Copy MD" button.

The original implementation caused a DOMException: NotAllowedError because navigator.clipboard.writeText() was called asynchronously after an await fetch(), causing the browser's user activation from the click to expire. The fix uses ClipboardItem with a promise-based blob to ensure navigator.clipboard.write() is called synchronously within the user gesture, while the content resolves asynchronously.


Slack Thread

Open in Web Open in Cursor 


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8357 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/5/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `cursor/docs-copy-button-error-7907` --- ### 📝 Commits (2) - [`7b2449c`](https://github.com/better-auth/better-auth/commit/7b2449ce1adaf11a9dd810b4e48d3e98f0a1c7d8) fix(docs): fix Copy MD button error on first click - [`db8b92e`](https://github.com/better-auth/better-auth/commit/db8b92e1a8b3ea9de9ce3a6836884595fc684175) Merge branch 'canary' into cursor/docs-copy-button-error-7907 ### 📊 Changes **1 file changed** (+21 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `landing/app/docs/[[...slug]]/page.client.tsx` (+21 -10) </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> Fix client-side error on first click of "Copy MD" button. The original implementation caused a `DOMException: NotAllowedError` because `navigator.clipboard.writeText()` was called asynchronously after an `await fetch()`, causing the browser's user activation from the click to expire. The fix uses `ClipboardItem` with a promise-based blob to ensure `navigator.clipboard.write()` is called synchronously within the user gesture, while the content resolves asynchronously. --- [Slack Thread](https://betterauth.slack.com/archives/C0A8B5BARUK/p1772579530105259?thread_ts=1772579530.105259&cid=C0A8B5BARUK) <p><a href="https://cursor.com/agents/bc-1bd0c91b-e536-5200-839f-0a2cbcc682e4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-1bd0c91b-e536-5200-839f-0a2cbcc682e4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</p> <!-- CURSOR_AGENT_PR_BODY_END --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:34:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#24821