question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug Report][2.5.0] v-click-outside firing lastMousedownWasOutside errors after component removal

See original GitHub issue

Environment

Vuetify Version: 2.5.0 Vue Version: 2.6.12 Browsers: Chrome 90.0.4430.212 OS: Linux x86_64

Steps to reproduce

  1. Go to the JSFiddle
  2. Click outside the drawer - it should close the drawer
  3. 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
sw517commented, Jul 29, 2021

Also running into this same issue.

I have a v-navigation-drawer inside a wrapper component and I’m passing the stateless prop so the value can be handled by the parent, but I’m having to use the v-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.

3reactions
KaelWDcommented, May 26, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found