Is it possible to ignore (inside a child) the phx-ignore of the parent?
E.g.:
Is it possible to ignore (inside a child) the phx-ignore of the parent?
E.g.:
After a tip from a colleague i tried Phoenix.Component — Phoenix LiveView v0.18.3 but it didnt fixed the issue unfortunately…
Also this answer How does phx-update="ignore" work? - #2 by chrismccord don’t get my hopes up
No it applies to the entire container
A possible workaround is to create a event listener and render the entire component and send it via an event to js.
https://hexdocs.pm/phoenix_live_view/js-interop.html#event-listeners
https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#push_event/3
socket
|> push_event(
"update_table_html",
%{
tableString:
Table.render(new_assigns)
|> Phoenix.HTML.Safe.to_iodata()
|> Enum.join()
}
)
Inside the event listener replace the current html with the new one.
window.addEventListener(`phx:update_table_html`, (e) => {
document.getElementById(element).innerHTML = e.detail.new_html;
})
Dunno how much this way decreases performance, but i´ve in production and didnt notice a decrease (yet).
Guess it shouldn´t be a problem for smaller components.