From 08c83fa555ec1a326911c71f48882d27621976a7 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 18 Sep 2023 23:34:12 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(parameterComponent):=20remov?= =?UTF-8?q?e=20unnecessary=20span=20element=20to=20improve=20code=20readab?= =?UTF-8?q?ility=20=F0=9F=94=A7=20fix(GenericNode):=20remove=20onClick=20e?= =?UTF-8?q?vent=20handler=20that=20resets=20filterEdge=20state=20to=20impr?= =?UTF-8?q?ove=20code=20simplicity=20=F0=9F=94=A7=20fix(PageComponent):=20?= =?UTF-8?q?add=20onPaneClick=20callback=20function=20to=20reset=20filterEd?= =?UTF-8?q?ge=20state=20when=20clicking=20on=20the=20pane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/parameterComponent/index.tsx | 1 - src/frontend/src/CustomNodes/GenericNode/index.tsx | 7 +------ .../FlowPage/components/PageComponent/index.tsx | 14 ++++++++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 10925cd99..0f31c7f42 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -251,7 +251,6 @@ export default function ParameterComponent({ > - {required ? " *" : ""} )} diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 1558c0731..0cee9557c 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -85,12 +85,7 @@ export default function GenericNode({
BETA
)} -
{ - setFilterEdge([]); - }} - > +
(null); const { takeSnapshot } = useContext(undoRedoContext); @@ -382,6 +387,10 @@ export default function Page({ [] ); + const onPaneClick = useCallback((flow) => { + setFilterEdge([]); + }, []); + return (
{!view && } @@ -429,6 +438,7 @@ export default function Page({ zoomOnPinch={!view} panOnDrag={!view} proOptions={{ hideAttribution: true }} + onPaneClick={onPaneClick} > {!view && (