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

Custom directive's unmounted event is not triggered on v-for element #12569

Open
morowind opened this issue Dec 17, 2024 · 1 comment · May be fixed by #11682
Open

Custom directive's unmounted event is not triggered on v-for element #12569

morowind opened this issue Dec 17, 2024 · 1 comment · May be fixed by #11682
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.

Comments

@morowind
Copy link

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNp9Uk2P0zAQ/SuDL2mlbKJSuJS04kOLgMOCAIkDRiibTFJvHTvyR+gqyn9nnLRZqkV7s+e9mXnzZnr2pm2TziPbsMwWRrQOLDrf7rgSTauNgx4MVjBAZXQDEVEjrrgqtLIOGlvDNuCL6ANKqeGHNrJ8Fi3PhE5YcSvxRHLG4/LVGcuNofjPVQzPY1j/mlPe68JbQnquABrtlcNyAwuUS9juSE6gaYmJ1PUiOuFRDCgTl9c3eYNLGOKQ69Wj7IvcGYfLdK4GrrJ0soOMoI/DppW5Q/oBzD/orkS15ew0JWcjTIT9CgirtCFQgFBhVs5gc8D7EKFnQGnMXd+PJg5Dlu5XU/X0slkpujP7cb/mHkh1lhJpYgvVevLwqtElSqJSceqWTuCtd04reF1IURwe6myrXNpQbS9KzNKJRRkXSljMnCX7KlEnd1YrOphxQZwVummFRPO5dYLs5WwzrS5gOR3Fn09jLCx/XMuYs8fi8J/4nT2GGGdfDFo0HamaMZebGt0EX3+7wSO9Z5Dm9cGRJ8CvSKv3QeNEe+tVSbL/4Y1qP45nL1T93V4fHSp7HioIDczpuMg9j++eGP1B7jp5MebRXZGLvzs0oSYZuE5eJqs1G/4C7noqsA==

Steps to reproduce

Press F12, Click the 'hide' button, console only logs Div's umounted event, H1's unmounted event is not logged

What is expected?

unmounted event in Directive should be triggered on elements with v-for

What is actually happening?

unmounted event in Directive is not triggered on elements with v-for

System Info

No response

Any additional comments?

No response

@morowind morowind changed the title Custom directive's umounted event is not triggered on v-for element Custom directive's unmounted event is not triggered on v-for element Dec 17, 2024
@jh-leong jh-leong added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Dec 18, 2024
@edison1105
Copy link
Member

edison1105 commented Dec 19, 2024

similar to #9239

The root cause is the missing NEED_PATCH. Elements are marked as NEED_PATCH when using custom directives individually, but when wrapped in v-for, NEED_PATCH is lost. will be fixed in #11682

For more similar issues, refer to #11682 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
Projects
None yet
3 participants