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
Description
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>