How can I detect input validation errors? #631
-
Currently, a user can input something like Is there any way for me to detect validation errors that are present for any block, and cancel saving if any are found? Can you point me to any docs concerning this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm sorry there is no such feature in Mosaico. If you want to try writing your own widgets you will have to put your hands in the code. You can read something here: This way you can only deal differently with the widget/validation when that property is edited. There is no provinsion in the Mosaico architecture to do model validation before saving and I don't think it would be a good UX option. |
Beta Was this translation helpful? Give feedback.
I'm sorry there is no such feature in Mosaico.
You can replace the editing widget and implement your own logic in the widget.
If you want to try writing your own widgets you will have to put your hands in the code. You can read something here:
https://github.com/voidlabs/mosaico/wiki/Mosaico-Plugins
and you can see the current url widget here:
https://github.com/voidlabs/mosaico/blob/master/src/js/converter/editor.js#L99
This way you can only deal differently with the widget/validation when that property is edited. There is no provinsion in the Mosaico architecture to do model validation before saving and I don't think it would be a good UX option.