From 39ac800ae1c5dfb23f53d3ef0d430d8c594058df Mon Sep 17 00:00:00 2001 From: huanhuanwa <44698191+huanhuanwa@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:28:40 +0800 Subject: [PATCH] fix(clipboard): only exec JSON.stringify for element #WIK-15713 (#271) --- .changeset/small-parrots-give.md | 5 +++++ packages/src/utils/clipboard/navigator-clipboard.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/small-parrots-give.md diff --git a/.changeset/small-parrots-give.md b/.changeset/small-parrots-give.md new file mode 100644 index 00000000..33b29f2b --- /dev/null +++ b/.changeset/small-parrots-give.md @@ -0,0 +1,5 @@ +--- +"slate-angular": patch +--- + +only exec JSON.stringify for element diff --git a/packages/src/utils/clipboard/navigator-clipboard.ts b/packages/src/utils/clipboard/navigator-clipboard.ts index 69876000..816c4932 100644 --- a/packages/src/utils/clipboard/navigator-clipboard.ts +++ b/packages/src/utils/clipboard/navigator-clipboard.ts @@ -11,7 +11,7 @@ export const setNavigatorClipboard = async (htmlText: string, data: Element[], t 'text/html': new Blob([htmlText], { type: 'text/html' }), - 'text/plain': new Blob([JSON.stringify(textClipboard ?? data)], { type: 'text/plain' }) + 'text/plain': new Blob([textClipboard ?? JSON.stringify(data)], { type: 'text/plain' }) }) ]); }