Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VAutocomplete): removeEventListener when destroyed #11811

Merged
merged 1 commit into from Jul 21, 2020

Conversation

Y--
Copy link
Contributor

@Y-- Y-- commented Jul 7, 2020

Description

Call document.removeEventListener when component is destroyed

Motivation and Context

VAutocomplete component leaks when the copy listener is attached to document but never released

How Has This Been Tested?

Manually. Please let me know how this is usually automatically tested.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@TravisBuddy
Copy link

TravisBuddy commented Jul 7, 2020

Hey @Y--,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 467e5e40-c068-11ea-8f0c-c508e01afe59

@johnleider
Copy link
Member

Can you provide a playground that reproduces the bug and/or reference an issue?

@Y--
Copy link
Contributor Author

Y-- commented Jul 8, 2020

I'm not sure if that's enough for you but here is an example:
https://codepen.io/y-the-encoder/pen/qBbogmR?editors=1010

Then just type something, and toggle the button to remove the autocomplete from the DOM: the element is removed but document.removeEventListener is never called.

Let me know if you need more for this. Thanks!

@KaelWD KaelWD changed the title removeEventListener when component is destroyed fix(VAutocomplete): removeEventListener when destroyed Jul 21, 2020
@KaelWD KaelWD merged commit e7c6ed5 into vuetifyjs:master Jul 21, 2020
@KaelWD KaelWD added this to the v2.3.x milestone Jul 21, 2020
@KaelWD KaelWD added C: VAutocomplete VAutocomplete performance The issue involves performance T: bug Functionality that does not work as intended/expected labels Jul 21, 2020
@KaelWD KaelWD self-assigned this Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VAutocomplete VAutocomplete performance The issue involves performance T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants