Skip to content

component with v-if="false" breaks transition mode="out-in" #4933

Closed as not planned

Description

@dodododooo

Version

3.2.21

Reproduction link

codesandbox.io

Playground without router

A more realistic example with a toggle for the component visibility

Steps to reproduce

  1. Click toggle multiple times

What is expected?

The comp1 should be visible when toggling back

What is actually happening?

Nothing is displayed after toggling once

Activity

  1. changed the title [-]component has empty template next route can`t render when use `transition` `out-in` mode.(使用`transition` `out-in` mode时,如果当前组件模版为空时,下次路由不渲染)[/-] [+]component has empty template next route can't render when use <transition> 'out-in' mode.(使用<transition> 'out-in' mode时,如果当前组件模版为空时,下次路由不渲染)[/+] on Nov 11, 2021
  2. changed the title [-]component has empty template next route can't render when use <transition> 'out-in' mode.(使用<transition> 'out-in' mode时,如果当前组件模版为空时,下次路由不渲染)[/-] [+]component with `v-if="false"` breaks transition `mode="out-in"`[/+] on Nov 11, 2021
  3. added
    🐞 bug
    on Nov 11, 2021
  4. dodododooo commented on Nov 12, 2021

    @dodododooo
    Author

    also when component have no template and render function

  5. edison1105 commented on Nov 12, 2021

    @edison1105
    Member

    as a workaround add a key to transition:

    <transition :key="key" name="fade" mode="out-in">
              <component :is="Component" :key="key" />
          </transition>
  6. edison1105 commented on Nov 12, 2021

    @edison1105
    Member

    the root cause is: instance.update is not run.
    1636725947(1)

  7. rashfael commented on Nov 25, 2021

    @rashfael

    This is probably related:
    When using mode="in-out" instead in the reproduction and navigating from next2 to next, the content of next2 does not disappear.

  8. added
    has workaround
    on Apr 1, 2024
  9. edison1105 commented on Sep 5, 2024

    @edison1105
    Member

    Closing as it no longer reproduces

  10. locked and limited conversation to collaborators on Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bughas workaroundscope: transition🔩 p2-edge-case

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions