Skip to content

Custom directive "inserted" hook doesn't fire when transition is used on binded element #6076

Closed
@DominikSerafin

Description

@DominikSerafin

Version

2.3.4

Reproduction link

https://jsfiddle.net/aL1dgdc8/11/

Steps to reproduce

  1. Create custom directive that uses inserted hook
  2. Apply that directive to element with v-if and wrapped in <transition>
  3. Toggle visibility of that element

What is expected?

inserted hook to fire (just like bind hook)

What is actually happening?

inserted hook doesn't fire at all


I've spent like couple of hours debugging this on my custom directive VueBar (DominikSerafin/vuebar#5) because I thought this was issue with my code. Unfortunately I think that's issue with Vue itself.

There is a workaround though; just wrap element with directive in another element that will get transitioned (like in 3rd example in the reproduction).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions