plate icon indicating copy to clipboard operation
plate copied to clipboard

"Copy to clipboard: ⌘+C, Enter" popup showing when trying to copy in Safari

Open justspamjustin opened this issue 3 months ago • 1 comments

Description

When using cmd+c to copy in safari, a popup shows up that says "Copy to clipboard: ⌘+C, Enter" and prevents the copy action from working.

Image

Reproduction URL

https://platejs.org

Reproduction steps

1. In Safari on a mac
2. Go to https://platejs.org
3. Click into the topmost example editor
4. Type cmd+a, then cmd+c
5. Notice the prompt/alert message as shown in the attached
6. After closing the alert, the contents weren't copied to the clipboard

Expected:
There should be no alert/popup and the selected contents should be copied to the clipboard

Plate version

latest version on platejs.org

Slate React version

latest on platejs.org

Screenshots


Logs


Browsers

Safari

justspamjustin avatar Sep 08 '25 13:09 justspamjustin

Hi @justspamjustin! I'm Dosu and I’m helping the plate team.

This popup is triggered by Safari's strict clipboard security. Plate (and Slate) use custom copy event handlers that call event.preventDefault() and set clipboard data programmatically. In Safari, this can cause the browser to block the copy action and show the native "Copy to clipboard: ⌘+C, Enter" prompt if the clipboard API isn't permitted or the event isn't considered user-initiated. There's no custom Plate UI for this—it's a browser-native popup caused by how Safari handles programmatic copy attempts source.

Currently, there's no built-in Plate or Slate config to bypass this. The best workaround is to adjust the copy event handler so it only calls preventDefault when custom clipboard data is actually set, and otherwise lets Safari's native copy run. You can also customize Plate's keyboard shortcuts so that preventDefault is only triggered when needed source.

Safari's clipboard restrictions are a browser limitation, so full programmatic control may not be possible. If you need a code example or want to discuss a workaround, let me know!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Sep 08 '25 13:09 dosubot[bot]