fix an issue w/ submitting when the dialog is invalid

This fixes a few issues related to submitting a dialog with invalid fields:
- override `onClick` in spark dialog buttons, to ensure that we do not send the onclick event for disabled buttons
- check dialog validity before we submit via a 'trigger on return' field. Before, you could submit a dialog that had a disabled submit button, via hitting return in a 'trigger on return' text field.
- add the ability for spark dialogs to respond to whether it is valid

fixes #2322; @ussuri
If the event is not stopped here, it may close the dialog. Can you confirm with `Git clone` dialog if it persists even after clicking ?