From 2d737a9fa506fa0764bf1e8f8cf79085bd1a414f Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Fri, 28 Jun 2024 01:16:00 -0300 Subject: [PATCH 1/3] Fix: Ctrl + C not working on tooltips --- .../src/pages/FlowPage/components/PageComponent/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index f302c70e3bd..db1736a60f7 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -228,7 +228,7 @@ export default function Page({ } function handleCopy(e: KeyboardEvent) { - if (!isWrappedWithClass(e, "nocopy")) { + if (!isWrappedWithClass(e, "nocopy") && isWrappedWithClass(e, "react-flow__node")) { e.preventDefault(); (e as unknown as Event).stopImmediatePropagation(); if (window.getSelection()?.toString().length === 0 && lastSelection) { From 63113aa8ea8a31d654993ab7f5c2dd9157f66e8a Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Fri, 28 Jun 2024 03:32:59 -0300 Subject: [PATCH 2/3] Refactor: enable node copy for multiple selection --- .../src/pages/FlowPage/components/PageComponent/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index db1736a60f7..e108156e40c 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -228,7 +228,8 @@ export default function Page({ } function handleCopy(e: KeyboardEvent) { - if (!isWrappedWithClass(e, "nocopy") && isWrappedWithClass(e, "react-flow__node")) { + const multipleSelection = lastSelection?.nodes ? lastSelection?.nodes.length > 0 : false; + if (!isWrappedWithClass(e, "nocopy") && (isWrappedWithClass(e, "react-flow__node") || multipleSelection)) { e.preventDefault(); (e as unknown as Event).stopImmediatePropagation(); if (window.getSelection()?.toString().length === 0 && lastSelection) { From fc137cc6900dbab57ae0429ad09c1df23faa5827 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 06:34:22 +0000 Subject: [PATCH 3/3] [autofix.ci] apply automated fixes --- .../pages/FlowPage/components/PageComponent/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index e108156e40c..87bbfbf685f 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -228,8 +228,13 @@ export default function Page({ } function handleCopy(e: KeyboardEvent) { - const multipleSelection = lastSelection?.nodes ? lastSelection?.nodes.length > 0 : false; - if (!isWrappedWithClass(e, "nocopy") && (isWrappedWithClass(e, "react-flow__node") || multipleSelection)) { + const multipleSelection = lastSelection?.nodes + ? lastSelection?.nodes.length > 0 + : false; + if ( + !isWrappedWithClass(e, "nocopy") && + (isWrappedWithClass(e, "react-flow__node") || multipleSelection) + ) { e.preventDefault(); (e as unknown as Event).stopImmediatePropagation(); if (window.getSelection()?.toString().length === 0 && lastSelection) {