solid-react-components icon indicating copy to clipboard operation
solid-react-components copied to clipboard

No way to change the behaviour of the submit button

Open michielbdejong opened this issue 6 years ago • 1 comments

You can pass an onSuccess button to the builder, but the Submit button and the fields of the resulting form are entirely shielded off from the rest of the app, so there is no way to for instance do some extra check apart from the Shex validation (e.g. an 'are you sure?' dialog, or any other customizations). A beforeSubmit callback would have been helpful for cases like this, I think.

michielbdejong avatar Dec 11 '19 16:12 michielbdejong

This is a good idea, and likely not that difficult to implement. Right now, we do have an onSave event called at the end of the built-in "save/submit", but no way to interrupt the process. perhaps as you suggest a beforeSave function that executes at the beginning of the save, or even a custom save function. Either could work, or perhaps both. Maybe return a bool that indicates if the save should execute or not?

james-martin-jd avatar Dec 11 '19 22:12 james-martin-jd