From 49829fbbcca3466657346c2b515cfbf451ab087f Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 15 Sep 2022 09:23:16 -0600 Subject: [PATCH] Fix OS copy using navigator.clipboard still showed "Use Ctrl+C..." --- api/js/egw_action/egw_action_popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/js/egw_action/egw_action_popup.js b/api/js/egw_action/egw_action_popup.js index 8ff17e095d..613a89abb0 100644 --- a/api/js/egw_action/egw_action_popup.js +++ b/api/js/egw_action/egw_action_popup.js @@ -788,7 +788,8 @@ export function egwPopupActionImplementation() { copyTextToClipboard(event, clipboard_action, os_clipboard_caption).then((successful) => { - if (successful) + // Fallback + if (typeof successful == "undefined") { // Clear message egw.message(egw.lang("'%1' copied to clipboard", os_clipboard_caption.length > 20 ? os_clipboard_caption.substring(0, 20) + '...' : os_clipboard_caption)); @@ -1008,7 +1009,7 @@ function copyTextToClipboard(event, action, text) if (!navigator.clipboard) { let success = fallbackCopyTextToClipboard(event, action, text); - return Promise.resolve(success); + return Promise.resolve(success ? undefined : false); } // Use Clipboard API return navigator.clipboard.writeText(text);