Closed teleskop150750 closed 4 weeks ago
the listener is bind on container
element, and seems like the cleanupFn
does triggered, what do you mean it's not removed ya? 😁
a new function is passed instead of a reference to the old one
watch(foo, (_, __, cleanupFn) => {
const bar = () => {}
container.removeEventListener(AUTOFOCUS_ON_MOUNT, bar)
cleanupFn(() => {
container.removeEventListener(AUTOFOCUS_ON_MOUNT,bar)
})
})
@zernonia Don't you want to collaborate with the Oku project or with me? I have a few questions about the current radix-vue codebase
Ahh you are right. Good catch. However it doesn't affect much as when the component is unmounted, it will be gone anyway, thus not really a bug. Thus closing.
@teleskop150750 Radix Vue has different vision compare to Oku. Feel free to open question on discussion if anything related to codebase ya
But you need to delete events to avoid memory leaks, and this deletion code doesn't work
@zernonia and what are your differences from Oku or my fork?
Environment
Link to minimal reproduction
https://github.com/radix-vue/radix-vue/blob/6dbf5805da20f585536fc8534a06a25956002dfa/packages/radix-vue/src/FocusScope/FocusScope.vue#L164
Steps to reproduce
https://github.com/radix-vue/radix-vue/blob/6dbf5805da20f585536fc8534a06a25956002dfa/packages/radix-vue/src/FocusScope/FocusScope.vue#L164
Describe the bug
Event handler is not removed
Expected behavior
No response
Context & Screenshots (if applicable)
No response