You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is useful to work around [a Safari bug](https://github.com/nolanlawson/emoji-picker-element/issues/281#issuecomment-3256832247)
426
+
when using the [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard), which causes
427
+
the error `NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.`
428
+
This error occurs due to Safari not recognizing that the `emoji-click` event is user-initiated due to the presence of
429
+
`await`s for IndexedDB data.
430
+
431
+
Example of correct usage to copy an emoji to the clipboard:
Copy file name to clipboardExpand all lines: custom-elements.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,10 @@
89
89
{
90
90
"name": "emoji-click",
91
91
"description": "The `emoji-click` event is fired when an emoji is selected by the user."
92
+
},
93
+
{
94
+
"name": "emoji-click-sync",
95
+
"description": "The `emoji-click-sync` event is fired synchronously when an emoji is selected by the user. Use this when copying data to the clipboard using the Clipboard API to work around a Safari bug."
0 commit comments