Skip to content

Commit

Permalink
Prevent form submission in Pagefind UI
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Jul 28, 2022
1 parent a99ad7b commit 86002e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pagefind_ui/svelte/ui.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
}
};
const showMore = () => {
const showMore = (e) => {
e?.preventDefault();
show += 5;
};
</script>
Expand All @@ -92,6 +93,7 @@
role="search"
aria-label="Search this site"
action="javascript:void(0);"
on:submit={(e) => e.preventDefault()}
>
<input
class="pagefind-ui__search-input"
Expand Down Expand Up @@ -140,6 +142,7 @@
</ol>
{#if searchResult.results.length > show}
<button
type="button"
class="pagefind-ui__button"
on:click={showMore}>Load more results</button
>
Expand Down

0 comments on commit 86002e9

Please sign in to comment.