File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 44 let {
55 children,
66 dialog = $bindable (),
7- submitText = ' Submit' ,
87 cancel = () => {},
8+ clearOnCancel = false ,
9+ submitText = ' Submit' ,
910 submit = (data : object ): Promise <any > => Promise .resolve (),
1011 pageMode = false ,
1112 submitDanger = false ,
1516 }: {
1617 children(): any ;
1718 dialog? : HTMLDialogElement ;
19+ clearOnCancel? : boolean ;
20+ /** A callback for when the dialog is canceled */
21+ cancel? (): unknown ;
1822 /** Change the text displayed for the submit button */
1923 submitText? : string ;
20- /** Basically a callback for when the dialog is canceled */
21- cancel? (): unknown ;
2224 /** Called on submission, this should do the actual submission */
2325 submit? (data : Record <string , FormDataEntryValue >): Promise <any >;
2426 /** Whether to display the dialog as a full-page form */
3638
3739 function onclose(e : Event ) {
3840 e .preventDefault ();
41+ if (clearOnCancel ) dialog ! .querySelector (' form' )! .reset ();
3942 cancel ();
4043 }
4144
You can’t perform that action at this time.
0 commit comments