Giter VIP home page Giter VIP logo

Comments (5)

Derick1530 avatar Derick1530 commented on September 16, 2024 2

@moklick I'm experiencing the following error when using custom handles (v12.0.3):

TypeError: Cannot read properties of null (reading 'position')
  at Object.onPointerDown
  at handleEdgeUpdater
  at onReconnectSourceMouseDown

Details:

In my project, I have custom handles that are dynamically added via a side panel. The error seems to be triggered under specific conditions related to the width of the custom node:

When I set the width of the parent custom handle to 100% and then dynamically change the node width, the error consistently occurs.
However, if I don't specify the width at all, the error disappears.
It seems the issue is tied to how the width is managed for these custom handles when the node width is updated.

Steps to Reproduce:

  • Set the parent custom handle width to 100%.
  • Dynamically update the content of your node to cause a change in the width of the custom node through a side panel.
    Add an additional handle.
  • Interact with the handles and observe the behavior (in v12.0.3, you won't get an error, but the handles won’t function as expected).

Screenshot:

image

from react-flow.

moklick avatar moklick commented on September 16, 2024 1

Thanks we will check it! It looks like a bug.

from react-flow.

peanudge avatar peanudge commented on September 16, 2024 1

i had similar experiences(like above case shared by @Derick1530) after i update node's data that raise changes of handle state. but, i resolved by calling updateNodeInternals(node.id) at next render cycle after changing data related handles.

from react-flow.

moklick avatar moklick commented on September 16, 2024

This is fixed in 12.0.3

from react-flow.

Derick1530 avatar Derick1530 commented on September 16, 2024

I will definitely try that, thanks @peanudge

just saw it in the docs : https://reactflow.dev/api-reference/components/handle#dynamic-handles

from react-flow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.