Skip to content

Commit b2ab338

Browse files
committed
remove modal on close
1 parent 6b7aa9b commit b2ab338

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

monsterui/franken.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ def Modal(*c, # Components to put in the `ModalBody` (often form
993993
if not id: id = fh.unqid()
994994
if hx_open: kwargs["hx_on__load"] = f"UIkit.modal('#{id}').show()"
995995
if hx_init and not hx_open: kwargs["hx_on__load"] = f"UIkit.modal('#{id}')"
996+
if hx_open or hx_init: kwargs["hx-on:hidden"] = "this.remove()"
996997
cls, dialog_cls, header_cls, body_cls, footer_cls = map(stringify, (cls, dialog_cls, header_cls, body_cls, footer_cls))
997998
res = []
998999
if header: res.append(ModalHeader(cls=header_cls)(header))

nbs/02_franken.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,7 @@
18101810
" if not id: id = fh.unqid()\n",
18111811
" if hx_open: kwargs[\"hx_on__load\"] = f\"UIkit.modal('#{id}').show()\"\n",
18121812
" if hx_init and not hx_open: kwargs[\"hx_on__load\"] = f\"UIkit.modal('#{id}')\"\n",
1813+
" if hx_open or hx_init: kwargs[\"hx-on:hidden\"] = \"this.remove()\"\n",
18131814
" cls, dialog_cls, header_cls, body_cls, footer_cls = map(stringify, (cls, dialog_cls, header_cls, body_cls, footer_cls))\n",
18141815
" res = []\n",
18151816
" if header: res.append(ModalHeader(cls=header_cls)(header))\n",

0 commit comments

Comments
 (0)