formio.js
formio.js copied to clipboard
[BUG] form.showError no longer accepts strings
- Formio.js version: 4.13.0
Steps to Reproduce
- form.showErrors('error');
- form.showErrors(['error']);
Expected behavior
Previous to https://github.com/formio/formio.js/commit/9d645494d4cb89b8fc5df78ae5a5bed0006504f0#diff-7855a6dd80d9df39fdfc8b5408184edab6a38ecfb49a165c448d5dfab1264a1fR1210 showError accepted a string or an array of strings
Observed behavior
showError fails with "TypeError: Cannot create property 'formattedKeyOrPath' on string"
Hello @paulfalgout, Can you provide an example of the issue taking place as well as a video?
No need for a video. https://jsfiddle.net/5cgkuj8n/
Formio.createForm(...).then(function(form) {
// Both of these used to work and now they don't
form.showErrors('error');
form.showErrors(['error']);
});
@paulfalgout
Was your issue addressed? The docs say it has to be an object but webform.js itself still uses string. This is getting quite confusing #4862
AFAIK this hasn't been addressed @bilogic
Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!