From c9ae32d4d04a0f682064157770d34aa73d321390 Mon Sep 17 00:00:00 2001 From: Konstantin Markov Date: Tue, 22 Oct 2024 10:57:11 +0300 Subject: [PATCH] Fix AI widget copy translation (#4668) (#4670) * Fix AI widget copy translation * Fix lint --- .../ai-widget/src/translations/translations-body.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/extensions/ai-widget/src/translations/translations-body.tsx b/scripts/extensions/ai-widget/src/translations/translations-body.tsx index cefc089213..dda068534f 100644 --- a/scripts/extensions/ai-widget/src/translations/translations-body.tsx +++ b/scripts/extensions/ai-widget/src/translations/translations-body.tsx @@ -118,7 +118,11 @@ export default class TranslationsBody extends React.Component { ariaValue={gettext('Copy')} icon="copy" onClick={() => { - navigator.clipboard.writeText(translation); + const clipboardItem = new ClipboardItem( + {'text/html': new Blob([translation], {type: 'text/html'})}, + ); + + navigator.clipboard.write([clipboardItem]); }} /> {this.props.mode === 'current' && (