From 22cd00ea8122eff2b67c0a2ac399d145ffb647bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Bascop=C3=A9?= Date: Thu, 8 Aug 2024 12:00:14 -0400 Subject: [PATCH 1/2] Added a isVisible validation when the input is not visible in mobile --- src/ValidationsFactory.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ValidationsFactory.js b/src/ValidationsFactory.js index d1445b448..a9ecc3ad0 100644 --- a/src/ValidationsFactory.js +++ b/src/ValidationsFactory.js @@ -240,6 +240,10 @@ class PageNavigateValidations extends Validations { */ class FormElementValidations extends Validations { async addValidations(validations) { + // Disable validations if field is hidden + if (!this.isVisible()) { + return; + } if (this.element.config && this.element.config.readonly) { //readonly elements do not need validation return; @@ -402,6 +406,8 @@ function ValidationsFactory(element, options) { if (element.component === 'FormButton' && element.config.event === 'pageNavigate') { return new PageNavigateValidations(element, options); } + console.log("Validations Factory element", element); + console.log("Validations Factory options", options); return new FormElementValidations(element, options); } From 61087088204ef4b617471ce60b6e86f729a47b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Bascop=C3=A9?= Date: Thu, 8 Aug 2024 13:03:06 -0400 Subject: [PATCH 2/2] removed code debug messages --- src/ValidationsFactory.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ValidationsFactory.js b/src/ValidationsFactory.js index a9ecc3ad0..23e0210ea 100644 --- a/src/ValidationsFactory.js +++ b/src/ValidationsFactory.js @@ -406,8 +406,6 @@ function ValidationsFactory(element, options) { if (element.component === 'FormButton' && element.config.event === 'pageNavigate') { return new PageNavigateValidations(element, options); } - console.log("Validations Factory element", element); - console.log("Validations Factory options", options); return new FormElementValidations(element, options); }