From 96b9baabbbeded972b1dad8da08bc3618d0e2489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Bascop=C3=A9?= Date: Mon, 1 Jun 2026 14:34:29 -0400 Subject: [PATCH] Added isVisible and insideLoop validation --- src/ValidationsFactory.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ValidationsFactory.js b/src/ValidationsFactory.js index 23e0210ea..03ead2a29 100644 --- a/src/ValidationsFactory.js +++ b/src/ValidationsFactory.js @@ -157,7 +157,7 @@ class FormLoopValidations extends Validations { return; } page.items.filter(item => { - if (item.component === 'FormLoop' && item.config.name === this.element.config.name) { + if (item.component === 'FormLoop' && item.config.name === this.element.config.name && item !== this.element) { siblings.push(item); } }); @@ -240,8 +240,10 @@ class PageNavigateValidations extends Validations { */ class FormElementValidations extends Validations { async addValidations(validations) { - // Disable validations if field is hidden - if (!this.isVisible()) { + // When inside a loop, each row may have different data so the static isVisible() + // check (which uses only the first row's data) cannot reliably determine visibility. + // The runtime closure evaluates conditionalHide per-row with the correct data. + if (!this.insideLoop && !this.isVisible()) { return; } if (this.element.config && this.element.config.readonly) {