hi,
I have a form which would update the assign form_data
in socket. I also have a tags
assign which contains a list of tag names, a focused_tags
assign which contains tag names that have been clicked.
Now, when I click a tag, I update the focused_tags
accordingly. Problem is, whatever new values in the form will be reseted every time I update focused_tags
(and only update it). Basically I did:
...phx-click="tag_clicked" phx-value-tag_id="<%=tag.id%>"...
{:noreply, sock |> assign(:focused_tags, [new_tag | focused_tags])}
Is there a way to have Liveview render only the relevant part (which is highlighting clicked tag names)? I thought that is the goal of Liveview, or did I do something wrong?
Thanks a lot…