🌻 [Feature]: Allow ref access of path elements in (Base-)Edge components #991
Replies: 12 comments
-
Will be fixed in |
Beta Was this translation helpful? Give feedback.
-
Correction, I will add this to const el = ref()
onMounted(() = {
const pathEl = el.value.nextSibling
}) To make this easier I will expose 3 refs in the next minor release.
const el = ref()
onMounted(() => {
console.log(el.value.pathEl.value, el.value.interactionEl.value, el.value.labelEl.value)
}) |
Beta Was this translation helpful? Give feedback.
-
regarding the workaround. In my case 'ref' value is undefined in 'onMounted' if I bind it on |
Beta Was this translation helpful? Give feedback.
-
Mh... strange, when I bind a ref like this |
Beta Was this translation helpful? Give feedback.
-
Another way to work around this for now would also be to use something like this // inside your custom edge
const { edgeEl } = useEdge()
onMounted(() => {
console.log(edgeEl.value.querySelector('path.vue-flow__edge-path'))
}) |
Beta Was this translation helpful? Give feedback.
-
I will try to reproduce it in the sandbox tomorrow. For some reason typescript compiler doesn't even allow me to do this |
Beta Was this translation helpful? Give feedback.
-
I assume you're using VSCode with Volar, right? |
Beta Was this translation helpful? Give feedback.
-
@bcakmakoglu can you make a fresh sandbox with the latest versions of all the libs installed from package.js, because 'npm install' is not doing it right and I don't understand how to fix it? |
Beta Was this translation helpful? Give feedback.
-
I'm converting this into a discussion as this is not a bug (as mentioned previously) and I want to keep Issues for bugs only :) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Is there an existing issue for this?
Current Behavior
When I create a custom edge, I would like to have the ability to interact with 'path' using web animation api for custom animations. To make the animation works I need 'ref' to the 'path' html element, but I can't get it using 'ref' currently because the value is always undefined.
Expected Behavior
Expect to have
edgeElement
ref value defined on 'onMouted' stage.Steps To Reproduce
Create
BaseEdge
with ref binding and check that on 'onMouted' state the ref value is undefined.Relevant log output
No response
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions