I have a modal that is managed inside of the parent liveview. The modal contains a form component. Since the buttons on the modal are at the top-level, I can’t submit the form directly.
How can I send a message to the form component that’s in the modal in order to submit it?
<%= case @modal_action do %>
# ..........
<% :record_decision -> %>
<.live_component
module={Modal}
id="record-decision-modal"
title="Record decision"
subtitle="Add a new decision to record the associated reasoning and discussion."
cancel_action="cancel_modal"
confirm_action="create_decision"
confirm_text="Create Decision">
<.live_component module={Decisions.Form} id="decision-form" account={@current_account} />
</.live_component>
<% _ -> %>
<div class="hidden"></div>
<% end %>