Comments (5)
@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:
from react-flow.
Thanks we will check it! It looks like a bug.
from react-flow.
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.
This is fixed in 12.0.3
from react-flow.
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)
- The “Handle” only indicates the type, but is used here as a value. HOT 3
- Version 11.11.3: onNodeClick Not Working with Touchpad Clicks
- onNodeDrag handler returns NaN as the position when dragging. HOT 3
- V12 Migration: Node type imported from @xyflow/react is missing positionAbsolute field HOT 3
- Dynamic positioning HOT 1
- V12 Migration: Nodes array missing provided order HOT 1
- Backgrounds and grid snapping are misaligned HOT 4
- If I have two ReactFlowProviders and some bacground elements, moving backroung on first moves it on later HOT 2
- any plan for education for lowest price for associated with reactflow pro ? HOT 1
- Autolayout Bug for Dagre algorithm HOT 2
- Is there any way to customize the connecting lines or display self-looping nodes better? HOT 3
- Why is it enlarged for no reason? HOT 4
- how can i set maxHeight dynamically when I resize the node HOT 1
- Need to disable the defalt zooming behaviour for the nodes
- The onNodeMouseEnter/Leave events do not cover the area of the NodeToolBar HOT 5
- React flow edges are not getting mounted on UI if browser zoom level is reduced to 80%, 90% or increased to 110% HOT 1
- isVisible support for Handle HOT 1
- Calculate viewport dimensions in `fitView` action
- Edges with `selectable` set to `false` are still included in lasso selections
- Rotation function, custom connection handle, the connection line is too far away from the handle HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-flow.