Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty query string. #78

Open
sideshot opened this issue Apr 11, 2024 · 3 comments
Open

Remove empty query string. #78

sideshot opened this issue Apr 11, 2024 · 3 comments

Comments

@sideshot
Copy link

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

@paoloricciuti
Copy link
Owner

You can set the empty string as default value and use showDefaults: false

@sideshot
Copy link
Author

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.

@paoloricciuti
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants