I was looking for the most concise way to close a simple modal (this problem again…) and I tried jamming a hidden button on my parent like
button [ id "Parent.CloseDialogMessage", onClick CloseDialogMessage ]
and then putting a separate button inside my child/modal with a
label [ for "Parent.CloseDialogMessage" ]
Obviously seems like it’s a mega-hack… but it works! And while the compiler won’t catch this if I forget to render the parent button with the child dialog, if I’m real careful ™ about always rendering the two together, it seems like the message shouldn’t get lost.
This saves me enough boilerplate not using OutMsg or translating from child to parent that it would be worth it if maintaining this were the only sacrifice.
Has anyone tried this already? Is there a good reason other than the obvious flaw listed that I shouldn’t go forward with this approach?
Would love to hear your thoughts. Thanks!