<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ankit</title>
    <description>The latest articles on Forem by Ankit (@ankitkeshari719).</description>
    <link>https://forem.com/ankitkeshari719</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F130443%2F977a639f-86fc-4a92-908a-b05db23197c6.jpeg</url>
      <title>Forem: Ankit</title>
      <link>https://forem.com/ankitkeshari719</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ankitkeshari719"/>
    <language>en</language>
    <item>
      <title>React Flow + react-resizable-panels double-click on node stops working after closing conditional form</title>
      <dc:creator>Ankit</dc:creator>
      <pubDate>Tue, 23 Sep 2025 13:31:04 +0000</pubDate>
      <link>https://forem.com/ankitkeshari719/react-flow-react-resizable-panels-double-click-on-node-stops-working-after-closing-conditional-17al</link>
      <guid>https://forem.com/ankitkeshari719/react-flow-react-resizable-panels-double-click-on-node-stops-working-after-closing-conditional-17al</guid>
      <description>&lt;p&gt;I am using React Flow along with react-resizable-panels and have divided the panel group into two parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Left panel: contains the React Flow graph.&lt;/li&gt;
&lt;li&gt;Right panel: contains a form.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The behavior is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On single click of a node → the form opens in the right panel.&lt;/li&gt;
&lt;li&gt;On double click of a node → the user is redirected to another flow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;:&lt;br&gt;
When I close the form conditionally (after it was opened on a single click), the &lt;strong&gt;double click event on the node stops working&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Double click works fine if I don’t open/close the form.&lt;/li&gt;
&lt;li&gt;Single click and double click both work individually.&lt;/li&gt;
&lt;li&gt;Only after closing the conditional form, double click doesn’t fire.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I debugged the event handlers and logic but couldn’t find the cause.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the sample code that I am trying to implement&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from "react";
import ReactFlow, { Background, Controls } from "reactflow";
import "reactflow/dist/style.css";
import {
  Panel,
  PanelGroup,
  PanelResizeHandle,
} from "react-resizable-panels";

const initialNodes = [
  {
    id: "1",
    position: { x: 100, y: 100 },
    data: { label: "Node 1" },
    type: "default",
  },
];

export default function App() {
  const [formOpen, setFormOpen] = useState(false);
  const [selectedNode, setSelectedNode] = useState(null);

  const handleNodeClick = (_, node) =&amp;gt; {
    setSelectedNode(node);
    setFormOpen(true); // open form on single click
  };

  const handleNodeDoubleClick = (_, node) =&amp;gt; {
    alert("Double click works! Navigating to flow: " + node.id);
    // navigation logic here...
  };

  return (
    &amp;lt;PanelGroup direction="horizontal"&amp;gt;
      &amp;lt;Panel defaultSize={70}&amp;gt;
        &amp;lt;ReactFlow
          nodes={initialNodes}
          onNodeClick={handleNodeClick}
          onNodeDoubleClick={handleNodeDoubleClick}
          fitView
        &amp;gt;
          &amp;lt;Background /&amp;gt;
          &amp;lt;Controls /&amp;gt;
        &amp;lt;/ReactFlow&amp;gt;
      &amp;lt;/Panel&amp;gt;

      &amp;lt;PanelResizeHandle /&amp;gt;

      &amp;lt;Panel defaultSize={30}&amp;gt;
        {formOpen &amp;amp;&amp;amp; (
          &amp;lt;div
            style={{
              border: "1px solid #ccc",
              padding: "10px",
              margin: "10px",
            }}
          &amp;gt;
            &amp;lt;h3&amp;gt;Form for {selectedNode?.data?.label}&amp;lt;/h3&amp;gt;
            &amp;lt;button onClick={() =&amp;gt; setFormOpen(false)}&amp;gt;Close Form&amp;lt;/button&amp;gt;
          &amp;lt;/div&amp;gt;
        )}
      &amp;lt;/Panel&amp;gt;
    &amp;lt;/PanelGroup&amp;gt;
  );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;:&lt;br&gt;
Has anyone faced a similar issue with React Flow + react-resizable-panels?&lt;br&gt;
How can I ensure that the double click event continues to work after conditionally opening/closing the form panel?&lt;/p&gt;

</description>
      <category>react</category>
      <category>help</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
