-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Hi again,
I want to use some links to patch my LiveView with the tab as a parameter:
@impl true
def handle_params(params, _uri, socket) do
{:noreply, assign(socket, :amenity_type, params["amenity"])}
endand then using this assign in tabs with the active attribute:
<:tab
icon="hero-squares-2x2"
active={@amenity_type == "shop"}
on_select={JS.patch(~p"/some/path?amenity=shop")}
>
</:tab>
<:tab
icon="hero-xyz"
active={@amenity_type == "restaurant"}
on_select={JS.patch(~p"/some/path?amenity=restaurant")}
>
</:tab>So far, so good. It works.
But when I patch from another place in the page, for example:
<.link patch={~p"/some/path?amenity=restaurant"}>
Go to restaurants
</.link>then nothing happens: the current tab stays the same.
In other words active seems to work only on initial rendering, then it becomes dead. Is that the normal behaviour?
I know about VoyageeWeb.Components.Tabs.show_tab/3 but i'D prefer not to use it and rely on active only.
Cheers!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels