Subscribe on changes!

Directive "unmounted" hook not called when wrapped in a Teleport

avatar
Aug 18th 2022

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-s84vrc?file=src/App.vue

Steps to reproduce

Click on the "Toggle components" button to show / hide the inputs. The "Mounted count" should switch between 0 and 1. Then click the "Toggle teleport" checkbox to enable the bugged input.

What is expected?

The "Mounted count" is always expected to be 0 when there is no input visible.

What is actually happening?

If "Toggle teleport" is checked, the counter only decrement by 1 when the inputs are hidden. Meaning the "unmounted" hook is not called.

System Info

No response

Any additional comments?

No response

avatar
Aug 18th 2022

duplicate of #6347