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

[2.x] Partial loading deferred props does not show fallback template #2139

Open
jason-nabooki opened this issue Dec 17, 2024 · 0 comments
Open

Comments

@jason-nabooki
Copy link

Version:

  • @inertiajs/vue3 version: 2.0.0

Describe the problem:

When a deferred prop is reloaded via partial reload, the fallback template should be displayed until the deferred prop is resolved.

For example, the page loads a list of users, which is a deferred prop. You have a search box that calls router.visit() and partial reloads the users using only. One would expect the fallback template to be displayed while the router.visit() is loading.

Steps to reproduce:

Backend

Route::get('/users', function () {
    return Inertia::render('Users/Index', [
        'users' => Inertia::defer(fn () => User::all()),
    ]);
});

Frontend

router.visit(url, { only: ['users'] })`

<Deferred data="users">
  <template #fallback>
    Loading...
  </template>

  <div>
    ... list of users ...
  </div>
</Deferred>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant