-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
[LiveComponent] Not write url query param when empty/default #2141
Comments
Oh and i also think the first one makes the more sense |
Hi there! Yes, it's a design choice here, see this comment in the feature PR. I would also prefer to not show all unchanged parameters in the URL, this would be a great improvement. But this is the tricky part: we would avoid props that didn't changed, not only those that are null, because a prop may be initialized with a default value on PHP side. I think the way Livewire handle this is pretty convenient: they use a |
I get it, it's all about what we write in the url if and only this is not the default param value. Not about the "empty string" case. LW solution seems OK. I'll try to make something around, or will ping here if it's too hard for me 🥷 1st though concern: having |
Hello,
Part of the discussion about faceted search/result combo (challenge point 3), I'm playing with live components and the feature to change an url when a LiveProp changes; I was wondering if there is actually a setting to remove the given param when its empty.
I explain a bit:
I have a "name" field wired to a live component with url: true. Assuming I write inside, my url will be
http://localhost/index?name=foo
. The question is if I reset the field, the URL will behttp://localhost/index?name=
but is there a way to enforce url to something likehttp://localhost/index
? It's cleaner, yes, but I think it's not trivia if you have a lot of params, because of a faceted search or other:http://localhost/index?name=&locationType=&location=&type=&domain=&status=&startDate=&endDate=
As far as I can think, I see 2 ways to add this:
I feel like the first is more elegant but that's only brainstorming!
If I may help in any way,
Best regards,
The text was updated successfully, but these errors were encountered: