Fix debug tab to copy displayed value

pull/5400/head
Kazuhito Yokoi 2025-12-06 00:21:16 +09:00
parent 6a75a084ad
commit 4b906734c9
1 changed files with 7 additions and 1 deletions

View File

@ -265,7 +265,13 @@ RED.utils = (function() {
var copyPayload = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-clipboard"></i></button>').appendTo(copyTools).on("click", function(e) {
e.preventDefault();
e.stopPropagation();
RED.clipboard.copyText(msg,copyPayload,"clipboard.copyMessageValue");
var payloadToCopy;
if (typeof msg === "number") {
payloadToCopy = obj.find(".red-ui-debug-msg-type-number").first().text();
} else {
payloadToCopy = msg;
}
RED.clipboard.copyText(payloadToCopy, copyPayload, "clipboard.copyMessageValue");
})
RED.popover.tooltip(copyPayload,RED._("node-red:debug.sidebar.copyPayload"));
if (enablePinning && strippedKey !== undefined && strippedKey !== '') {