From b09c4eee9028e35ba4194be25eb0ccf8b23e734a Mon Sep 17 00:00:00 2001 From: alexandraRamanenka Date: Thu, 13 Mar 2025 15:52:04 +0200 Subject: [PATCH] FIO-9813: Add validate when hidden property to the Nested Form in any on the children has it --- src/components/form/Form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/form/Form.js b/src/components/form/Form.js index 4b9652baac..3cdb51c49e 100644 --- a/src/components/form/Form.js +++ b/src/components/form/Form.js @@ -437,6 +437,12 @@ export default class FormComponent extends Component { // Iterate through every component and hide the submit button. eachComponent(form.components, (component) => { this.hideSubmitButton(component); + if (component.validateWhenHidden) { + this.component.validateWhenHidden = true; + // Change original component as well, so it won't cause any custom logic to be continuously triggered + // because the original component does not have this property + this.originalComponent.validateWhenHidden = true; + } }); // If the subform is already created then destroy the old one.