Skip to content

[Bug] A hook to only copy to clipboard #200

@erayerdin

Description

@erayerdin

Description

useClipboard or useCopyToClipboard hooks return [string, (text: string) => Promise<void>] where 0 is the content from the clipboard while 1 is the function to write into it. The problem is, Chrome asks for permission which might look suspicious for some users, not good in terms of UX and it is reasonable to only write into clipboard.

Image

Reproduction

Steps to reproduce the behavior:

  1. Install @reactuses/core
  2. Use hook useClipboard or useCopyToClipboard
  3. Chrome asks for permission.

Expected Behavior

Chrome should not ask for permission. There must be a hook to only write into the clipboard.

Environment

  • OS: Linux
  • Browser: 148.0.7778.178 (Official Build, ungoogled-chromium) (64-bit)
  • React version: 19.2.6
  • @reactuses/core version: 6.3.2

Additional Context

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions