Skip to content

Export - Copy to clipboard doesn't work in Safari #1266

@somelinguist

Description

@somelinguist

Using the Copy to clipboard button in the Export section of an item doesn't work in Safari. The buttons for the DOI and Citation sections do work, just not the Export section.

Clicking the button in the Export section gives the following error in the Javascript console with every format I try.

Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent 
or the platform in the current context, possibly because the user denied permission.

It sounds like it might be trying to write to the clipboard during an async call. Safari doesn't permit clipboard writes without user interaction, so the async calls have to be handled correctly (see for example, https://wolfgangrittner.dev/how-to-use-clipboard-api-in-safari/).

I'm not sure, but I think this PR is related: inveniosoftware/invenio-app-rdm#3106

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions