Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Preload should be triggered on goto(<self>) #349

Open
@mhkeller

Description

@mhkeller

I'll make a proper reproduction repo this evening but for now scaffolding out the issue.

If you make a simple search form like this, preload should fire when you navigate using goto. It currently does not.

<svelte:head>
  <title>Search</title>
</svelte:head>

<h1>Search</h1>

<form class="search" method="GET">
  <input name="search" type="search" placeholder="" bind:value/>
  <input type="submit" />
</form>

<script>
import { goto } from 'sapper/runtime.js';

export default {
  data () {
    return {
      value: ''
    };
  },
  methods: {
    query (e) {
      e.preventDefault();
      const { value } = this.get();
      goto(`/search?search=${value}`);
    }
  },
  preload ({ query }) {
    console.log('this should appear on form submission. But it does not', query.search);
    // const results = await this.fetch(`search.json`);
  }
};
</script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions