Skip to content

Commit

Permalink
Prefill afterNavigate
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Dec 10, 2024
1 parent 3beefa5 commit 2da2885
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/components/forms/AddOnDispatch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
$: validator = ajv.compile({ type: "object", properties, required });
$: hasEvents = eventOptions && eventOptions.events.length > 0;
$: hasFields = Object.keys(properties).length > 0;
// prefill values from search params
$: new URLSearchParams($page.url.searchParams).forEach((v, k) => {
if (k in properties) {
$values[k] = v;
}
});
afterNavigate(() => {
// set initial values
Expand All @@ -67,6 +61,12 @@
event: schedules[event.event],
};
}
// prefill values from search params
new URLSearchParams($page.url.searchParams).forEach((v, k) => {
if (k in properties) {
$values[k] = v;
}
});
});
function objectify(params: any) {
Expand Down

0 comments on commit 2da2885

Please sign in to comment.