Closed zswaff closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
lexical-vue | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 16, 2023 9:10pm |
lexical-vue-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 16, 2023 9:10pm |
Background
The fix that I implemented in #20 helped but did not fix all cases. Because
removeEventListener
requires the exact same function to be passed to it that was originally passed toaddEventListener
, calling unregister from a different editor doesn't do anything, leaving the listeners. This is a memory leak but more importantly it means that if you later reregister listeners, there are an even number, and checklist clicks again do not work.Repro
Fix
This fix uses the same patterns but simplifies the listenerManager signature and ensures that the final unregistration calls the reverse of the original registration.