mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
Fix clipboard write for Safari (#2283)
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
parent
26b319b294
commit
a0814a356f
@ -47,7 +47,18 @@ export async function copyToClipboard (object: Issue, ev: Event, { type }: { typ
|
||||
default:
|
||||
return
|
||||
}
|
||||
await navigator.clipboard.writeText(text)
|
||||
|
||||
try {
|
||||
// Chromium
|
||||
await navigator.clipboard.writeText(text)
|
||||
} catch {
|
||||
// Safari specific behavior
|
||||
// see https://bugs.webkit.org/show_bug.cgi?id=222262
|
||||
const clipboardItem = new ClipboardItem({
|
||||
'text/plain': Promise.resolve(text)
|
||||
})
|
||||
await navigator.clipboard.write([clipboardItem])
|
||||
}
|
||||
}
|
||||
|
||||
export function generateIssueShortLink (issueId: string): string {
|
||||
|
Loading…
Reference in New Issue
Block a user