def get_user_modal(session):
return Modal(
Form(
LabelInput("First Name", id="first_name"),
LabelInput("Last Name", id="last_name"),
LabelSelect(
Option("Primary User", "primary_user"),
Option("Secondary User", "secondary_user"),
id="user_type"
),
cls="space-y-4",
),
header=ModalTitle("Add New User"),
footer=ModalFooter(
ModalCloseButton(),
),
hx_open=True,
uk_modal="bg-close: false; esc-close: false; stack: true; bg-close-esc: false"
)
When using the
LabelSelect()inside aModal(), selection of an option from the drop down list appears to dismiss the modal. This appears to be a UI issue only - there doesn't appear to be any server calls on selection.