Open sideshot opened 4 months ago
You can set the empty string as default value and use showDefaults: false
Strange, that is what I'm doing. I saw that suggestion in another issue. Once I select and then deselect, it still ends up with ?filter_category=
const selected = queryParam(`filter_${section.id}`,ssp.string(''),{
showDefaults: false
});
<input
id={`filter-${section.id}-${optionIdx}`}
value="{option.value}"
type="checkbox"
bind:group={$selected}
class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
/>
Any thoughts? Awesome script, by the way.
I don't think you can use a string to bind to a checkbox group...if you prepare a reproduction I can try to take a look
Describe the bug
How do I get an empty query string off the URL?
Reproduction
Add with data then try to remove.
Logs
No response