Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: text copy issue #723

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Conversation

MatriQ
Copy link
Contributor

@MatriQ MatriQ commented Aug 2, 2023

Related to #701

CHANGES:

  • Removing the condition about navigator?.clipboard, it's not supported by all browsers, but the library copy-to-clipboard should be supported by all browsers.
  • Removing exception catching, writeText should be no possible to throw exceptions ( can be verified by reading the source code of copy-to-clipboard)

TO BE DISCUSSION:
It's unnecessary to use a state to save the copied text and return it from the hook, and there is also nowhere to use it. I even thought there is no need for this hook to exist and we should directly import copy-to-clipboard and use writeText instead.

@crazywoola crazywoola self-requested a review August 3, 2023 01:09
@crazywoola
Copy link
Member

Yes you can do this. I am ok with these changes.

@MatriQ MatriQ marked this pull request as ready for review August 3, 2023 03:11
@MatriQ MatriQ force-pushed the fix/text-copy-issue branch from e4bf9b7 to 0abc919 Compare August 3, 2023 03:59
@crazywoola crazywoola merged commit a25e038 into langgenius:main Aug 4, 2023
Octivian pushed a commit to Octivian/dify that referenced this pull request Aug 8, 2023
@MatriQ MatriQ deleted the fix/text-copy-issue branch August 9, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants