Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

fix TypeError: Cannot read properties of undefined (reading 'writeText')#303

Merged
asim-shrestha merged 1 commit intoreworkd:mainfrom
codecsrayo:main
Apr 22, 2023
Merged

fix TypeError: Cannot read properties of undefined (reading 'writeText')#303
asim-shrestha merged 1 commit intoreworkd:mainfrom
codecsrayo:main

Conversation

@codecsrayo
Copy link
Copy Markdown
Contributor

This pull request implements a fix for a TypeError that occurs when trying to use the navigator.clipboard.writeText method in Microsoft Edge, which may not have support for the Clipboard API in some versions. To resolve this issue, we have added a check for the existence of the navigator.clipboard object before attempting to use the writeText method. In cases where the Clipboard API is not supported, we have provided a fallback method for copying text to the clipboard using a temporary textarea element.

This fix ensures compatibility with Microsoft Edge and other browsers that may have limited or no support for the Clipboard API, preventing the TypeError from occurring and enabling the text copy functionality to work as expected.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2023

@codecsrayo is attempting to deploy a commit to the reworkd Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agent-gpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2023 4:03am

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants