[Bug Report][2.5.0] v-click-outside firing lastMousedownWasOutside errors after component removal
See original GitHub issueEnvironment
Vuetify Version: 2.5.0 Vue Version: 2.6.12 Browsers: Chrome 90.0.4430.212 OS: Linux x86_64
Steps to reproduce
- Go to the JSFiddle
- Click outside the drawer - it should close the drawer
- After drawer is closed, click anywhere, it fires
"Uncaught TypeError: Cannot read property 'lastMousedownWasOutside' of undefined"
with every click
Expected Behavior
After component removal all registered handlers should be detached and not called anymore
Actual Behavior
After component removal some of the handlers are still called causing errors
Reproduction Link
https://jsfiddle.net/6sayebj5/1/
Other comments
I have detected this doesn’t cause any side effects for users, but it is bloating console with errors
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also running into this same issue.
I have a v-navigation-drawer inside a wrapper component and I’m passing the
stateless
prop so thevalue
can be handled by the parent, but I’m having to use thev-click-outside
directive to emit the close event to the parent so the drawer is not persistent and every time I click anywhere after route change I get this error.The root cause of this is that v-navigation-drawer also uses click-outside, so it’s bound twice to the same element. There’s nothing checking if it’s already been bound or not, so the first event listener is overwritten and therefore not removed on unbind.