Closed meet1919 closed 3 months ago
View function updateConnectionNodes(id)
Example use:
editor.updateConnectionNodes('node-5');
Ohh yes. Sorry, I didnt study the documentation well.
the connection tries to update but doesnt attaches to the actual position of input and output when the node resizes. What should be the problem now? It is working when I drag the nodes, so same function applies here. It should work as expected right?
Same function
yeah, but it doesnt work properly. But works properly when node is dragged.
here how I am using it
$('#project-details').on('click', '.add-input', function () {
$(this).prop('hidden', true)
$(this).parent().find('.remove-input').prop('hidden', false)
$(this).parent().find('.user-instruction-input').show(100)
let node_id = $(this).closest('.drawflow-node').attr('id')
drawflow.updateConnectionNodes(node_id)
})
$('#project-details').on('click', '.remove-input', function () {
$(this).prop('hidden', true)
$(this).parent().find('.add-input').prop('hidden', false)
$(this).parent().find('.user-instruction-input').hide(100)
let node_id = $(this).closest('.drawflow-node').attr('id')
drawflow.updateConnectionNodes(node_id)
})
Could it be because it is taking 100 miliseconds to hide and show? Try settimeout.
Or prepare a codepen or sandbox to try
Yeah, 100 ms was the problem.
The node which I am using has the following css
when the node resizes the
input
andoutput
are shifted also as they should be at the vertical center of the node. But the thing is connection doesn't shift. It attaches/shifts instantly to theinput
andoutput
when I drag the node.the problem occurs here
the
d
attribute of path should dynamically update when node resizes.