Open felicien-brochu opened 4 years ago
That's not true, in the destroyed() hook is a removeEventListener.
Hey @felicien-brochu those are 2 separate issues please open a new issues for the directive issue and lets discuss there.
About the event listener, feel free to open a PR with the fix to remove that listener.
The "resize" listener added on window here: https://github.com/JonathanDn/vue-dropdown/blob/03ba5754c370fa257277fb7ca1d7ce6250a4f179/dropdown.vue#L96 is never removed. It leads to memory leak. Also I think you should not use a directive here. Because you cannot retain a reference to the closure calcHeight() in the directive, so you won't be able to remove the listener afterwards.