From 37cec2887df57f6f6181a206c69245adf57aa761 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 21 Dec 2017 09:43:22 -0700 Subject: [PATCH] fix copy bug where copy would only contain previously selected text --- src/core_plugins/kibana/public/home/copy_to_clipboard.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core_plugins/kibana/public/home/copy_to_clipboard.js b/src/core_plugins/kibana/public/home/copy_to_clipboard.js index 824363307e32f..81c42adc18be5 100644 --- a/src/core_plugins/kibana/public/home/copy_to_clipboard.js +++ b/src/core_plugins/kibana/public/home/copy_to_clipboard.js @@ -26,6 +26,7 @@ export function copyToClipboard(text) { try { document.body.appendChild(elementToBeCopied); range.selectNode(elementToBeCopied); + selection.empty(); selection.addRange(range); if (!document.execCommand('copy')) {