From e5d1fe236283fc838b8246ddba06c9fdce07089d Mon Sep 17 00:00:00 2001 From: Wrongecho Date: Thu, 10 Sep 2026 14:43:28 +0000 Subject: [PATCH] Fix copying text in the dynamic modals (api, credenials) --- js/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 7ad0ac28d..b1412c5a2 100644 --- a/js/app.js +++ b/js/app.js @@ -653,7 +653,15 @@ function itflowInit() { // Clipboard itflowStep('clipboard', function () { - var clipboard = new ClipboardJS('.clipboardjs'); + if (window.itflowClipboard) { + window.itflowClipboard.destroy(); + } + + var modals = document.querySelectorAll('.modal'); + var clipboard = new ClipboardJS('.clipboardjs', { + container: modals.length ? modals[modals.length - 1] : document.body + }); + window.itflowClipboard = clipboard; clipboard.on('success', function(e) { flashTooltip(e.trigger, 'Copied!');