Skip to content

ClipboardButton doesn't work on insecure pages #2298

@shadowusr

Description

@shadowusr

Describe the bug

When trying to copy anything using ClipboardButton component on any page that is not considered secure (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts), copy won't happen silently due to this code: https://github.com/gravity-ui/uikit/blob/main/src/components/CopyToClipboard/copyText.ts, since navigator?.clipboard?.writeText is not available.

For apps relying on Gravity ui and running on dev vms for instanse, this leads to broken UX.

Reproduction

N/A

Steps to reproduce

No response

Environment

Any browser

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions