In an elixir phoenix liveview, I have a modal that is opened like so:
<button
@click={"open_modal_#{@element.id} = !open_modal_#{@element.id}}"}></button>
and then
<div x-show={"open_modal_#{@element.id}"} x-cloak>
What I would want to do is to, after submitting a form on the modal, close the modal by negating
{"open_modal_#{@element.id}"}
to keep the x-data coherent. I would like to use Phoenix.LiveView.JS for this, but I don't know if this is possible. Is there a way to do this ? Otherwise, is there any other possibility to change x-data from .ex files?