formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

Tabs content validation errors are not displayed on submit

Open Sipaha opened this issue 7 years ago • 9 comments

https://github.com/formio/formio.js/blob/master/src/components/tabs/Tabs.js

In function checkValidity on line 236 component fill validityTabs array to return it later in getAllComponents (line 209), but component.destroy() (line 238) cleans all saved components and we are losing all errors.

This issue can be reproduced here http://jsfiddle.net/v38du9y1/1145/ You can press Submit button and see that error about mandatory field is missing.

It will be great if you fix it. Thanks

Sipaha avatar May 13 '19 07:05 Sipaha

My attempts to fix the component with minor changes was failed and I changed the component to render all children on create without destroing it on tab switch. Should I make pull request with this fix or it is a bad solution for Formio.js?

Sipaha avatar May 21 '19 03:05 Sipaha

Feel free to make a pull request if you have changes that work. We love community provided fixes.

What you are describing sounds like something that is fixed in the 4.x branch which is currently in the beta process of release. We create all the components in the tabs regardless of if they are visible or not. I'd recommend testing out 4.0.0-beta.33 and see if it works better for you.

randallknutson avatar May 21 '19 14:05 randallknutson

@Sipaha We would be interested in what you did to fix the tab component. We are not quite brave enough to try v4 just yet, but need the tabs component to work.

CoreNetJC avatar May 23 '19 04:05 CoreNetJC

I'd recommend testing out 4.0.0-beta.33 and see if it works better for you.

@randallknutson will be 4.0.0 released soon? Does it have backward compatibility with form configs from 3.*? Thanks

Sipaha avatar May 23 '19 11:05 Sipaha

4.0.0 is nearing release. The main holdback at the moment is full pdf support and squashing the remaining bugs which is getting a lot of attention at the moment. It will be backwards compatible with form configs.

randallknutson avatar May 23 '19 14:05 randallknutson

Thanks @Sipaha the bug fix is working well!

CoreNetJC avatar May 23 '19 18:05 CoreNetJC

4.0.0 is nearing release. It will be backwards compatible with form configs.

@randallknutson great to hear! Thank you and your team for the awesome library! @ProteanHub you're welcome.

Sipaha avatar May 24 '19 02:05 Sipaha

Thank you @Sipaha for the fix!

asamaha1 avatar May 30 '19 08:05 asamaha1

Thanks @Sipaha Created a gist for the modified Tabs.js by @Sipaha Just in case anyone wants it quickly

bohan avatar Jun 19 '19 20:06 bohan