Open karimfromjordan opened 1 year ago
It doesn't have all the details, but I took some notes on my solution for this: https://geoffrich.net/posts/marvel-filter-state/#heading-automatically-submitting-the-form-with-requestsubmit. It's for a Marvel comics search form that has both text inputs (that I debounce) and checkboxes.
It doesn't take into account the new data-sveltekit-replacestate
and data-sveltekit-keepfocus
link options, which weren't available when I wrote this, so I had to write a custom submit handler instead.
Oh~ interesting. Yeah this is pretty much what I had in mind. I recently worked on a dictionary site for a client where I also wrestled with some of the points you mention in the blog post. Thanks for the link. Will probably be a good idea then to put all of this into a working example.
This surprisingly came up several times this week on Discord — a page that should fetch, filter and search some data through a
<form>
and search params inload
. My idea was a simple products, words, fruits etc. page which:<input type="search" />
to search for specific items<input type="search" />
submits the formon:input
(debounced)on:change
Map
that acts as a database