From eeda38f3e6d22238ec70d040b4e239ce23f649a3 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 24 Oct 2018 17:37:53 +0200 Subject: [PATCH] [FIX] web: copy traceback in firefox Same issue as in 902e484f1. In some browser (eg. firefox) the container parameter of ClipboardJS is needed if the focus is inside the modal so the copy work. See information on: https://github.com/zenorocha/clipboard.js/pull/368 opw-1902040 closes #28117 --- addons/web/static/src/js/services/crash_manager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/services/crash_manager.js b/addons/web/static/src/js/services/crash_manager.js index 406693b67ca74..e1da816c8e5de 100644 --- a/addons/web/static/src/js/services/crash_manager.js +++ b/addons/web/static/src/js/services/crash_manager.js @@ -130,7 +130,11 @@ var CrashManager = core.Class.extend({ clipboard = new window.ClipboardJS($clipboardBtn[0], { text: function () { return (_t("Error") + ":\n" + error.message + "\n\n" + error.data.debug).trim(); - } + }, + // Container added because of Bootstrap modal that give the focus to another element. + // We need to give to correct focus to ClipboardJS (see in ClipboardJS doc) + // https://github.com/zenorocha/clipboard.js/issues/155 + container: dialog.el, }); clipboard.on("success", function (e) { _.defer(function () {