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

Suspense emits fallback but does not displays the slot when using a transition #3963

Closed
posva opened this issue Jun 16, 2021 · 2 comments · Fixed by #3968
Closed

Suspense emits fallback but does not displays the slot when using a transition #3963

posva opened this issue Jun 16, 2021 · 2 comments · Fixed by #3968
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: suspense scope: transition

Comments

@posva
Copy link
Member

posva commented Jun 16, 2021

Version

3.1.1

Reproduction link

SFC Playground

Steps to reproduce

  1. Click on toggle

What is expected?

The fallback content should be displayed

What is actually happening?

It's not


  • The fallback event seems to be correctly emitted
@posva posva added 🐞 bug Something isn't working ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: suspense scope: transition labels Jun 16, 2021
@posva posva added the has workaround A workaround has been found to avoid the problem label Jun 16, 2021
@posva
Copy link
Member Author

posva commented Jun 16, 2021

As a workaround it's possible to add a v-else case:

<Suspense>
      <template #default>
        <component v-if="Component" :is="Component" />
        <span v-else></span>
      </template>
      <template #fallback>
        <p>Loading...</p>
      </template>
    </Suspense>

@edison1105
Copy link
Member

      if (delayEnter) {
+       suspense.isInFallback = true
        activeBranch!.transition!.afterLeave = mountFallback
      }
      // unmount current active branch
      unmount(
        activeBranch!,
        parentComponent,
        null, // no suspense so unmount hooks fire now
        true // shouldRemove
      )

will works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: suspense scope: transition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants