🔧 fix(parameterComponent): remove unnecessary span element to improve code readability
🔧 fix(GenericNode): remove onClick event handler that resets filterEdge state to improve code simplicity 🔧 fix(PageComponent): add onPaneClick callback function to reset filterEdge state when clicking on the pane
This commit is contained in:
parent
8dd9cb29b5
commit
08c83fa555
3 changed files with 13 additions and 9 deletions
|
|
@ -251,7 +251,6 @@ export default function ParameterComponent({
|
|||
></Handle>
|
||||
</ShadTooltip>
|
||||
</div>
|
||||
<span className="text-status-red">{required ? " *" : ""}</span>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,12 +85,7 @@ export default function GenericNode({
|
|||
<div className="beta-badge-content">BETA</div>
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
className="generic-node-div-title"
|
||||
onClick={() => {
|
||||
setFilterEdge([]);
|
||||
}}
|
||||
>
|
||||
<div className="generic-node-div-title">
|
||||
<div className="generic-node-title-arrangement">
|
||||
<IconComponent
|
||||
name={name}
|
||||
|
|
|
|||
|
|
@ -64,8 +64,13 @@ export default function Page({
|
|||
setTabsState,
|
||||
tabId,
|
||||
} = useContext(TabsContext);
|
||||
const { types, reactFlowInstance, setReactFlowInstance, templates } =
|
||||
useContext(typesContext);
|
||||
const {
|
||||
types,
|
||||
reactFlowInstance,
|
||||
setReactFlowInstance,
|
||||
templates,
|
||||
setFilterEdge,
|
||||
} = useContext(typesContext);
|
||||
const reactFlowWrapper = useRef<HTMLDivElement>(null);
|
||||
|
||||
const { takeSnapshot } = useContext(undoRedoContext);
|
||||
|
|
@ -382,6 +387,10 @@ export default function Page({
|
|||
[]
|
||||
);
|
||||
|
||||
const onPaneClick = useCallback((flow) => {
|
||||
setFilterEdge([]);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex h-full overflow-hidden">
|
||||
{!view && <ExtraSidebar />}
|
||||
|
|
@ -429,6 +438,7 @@ export default function Page({
|
|||
zoomOnPinch={!view}
|
||||
panOnDrag={!view}
|
||||
proOptions={{ hideAttribution: true }}
|
||||
onPaneClick={onPaneClick}
|
||||
>
|
||||
<Background className="" />
|
||||
{!view && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue