vuetifyjs / vuetifyjs/vuetify

[Bug Report][3.9.4] Memory leak in Touch directive

Open
#21,887 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

D: directive component T: bug
Dominant language
TypeScript
Stars
41k
Forks
7.1k
Avg merge
1d 21h
Merged PRs (30d)
11

Description

Environment

Vuetify Version: 3.9.4
Vue Version: 3.5.18
Browsers: Google Chrome
OS: Windows 10

Steps to reproduce
  1. Dev Tool snapshots
  2. Toggle v-window
  3. Dev Tool snapshots
  4. compare result
Expected Behavior

Touch directive event listeners is clear as expected

Actual Behavior

Event Listeners cannot be clear

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments
  1. if we set the parent to true of Touch directive, the parent will always be null in unmount(vue3)/unbind(vue2) which means we may use weakRef or something record the parentElement

https://github.com/vuetifyjs/vuetify/blob/aeb00771e08665b9b10d3d3426d4bd8e2afdc86e/packages/vuetify/src/directives/touch/index.ts#L136

  1. the params of removeEventListeners should always be equal to addEventListeners

https://github.com/vuetifyjs/vuetify/blob/aeb00771e08665b9b10d3d3426d4bd8e2afdc86e/packages/vuetify/src/directives/touch/index.ts#L144

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/vuetify/src/directives/touch/index.ts, especially the referenced lifecycle and removeEventListeners lines. Reproduce the issue in the linked Vuetify Playground by toggling v-window and comparing Chrome DevTools snapshots. Trace whether unmount/unbind retains the parent and whether removal receives the same parameters as registration; done means Touch event listeners are cleared and no longer accumulate.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.