@4site/engrid-scripts 0.22.1 → 0.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AppVersion = "0.22.1";
1
+ export declare const AppVersion = "0.22.3";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const AppVersion = "0.22.1";
1
+ export const AppVersion = "0.22.3";
@@ -139,13 +139,21 @@ export class WelcomeBack {
139
139
  ENGrid.setBodyData("hide-fast-personal-details", false);
140
140
  return;
141
141
  }
142
- const regionFieldValue = ENGrid.getFieldValue("supporter.region");
142
+ const regionField = ENGrid.getField("supporter.region");
143
+ const regionFieldValue = regionField ? regionField.value : "";
144
+ const regionFieldType = regionField === null || regionField === void 0 ? void 0 : regionField.tagName.toLowerCase();
143
145
  const regionFieldLabel = document.querySelector(".en__field--region label");
144
- if (regionFieldLabel && regionFieldValue === "") {
146
+ if (regionFieldType === "select" &&
147
+ regionFieldLabel &&
148
+ regionFieldValue === "") {
145
149
  ENGrid.setError(".en__field--region", `${regionFieldLabel.innerText} is required`);
146
150
  ENGrid.setBodyData("hide-fast-personal-details", false);
147
151
  this._form.validate = false;
148
152
  }
153
+ else {
154
+ // Remove the error message if the region field is filled
155
+ ENGrid.removeError(".en__field--region");
156
+ }
149
157
  }
150
158
  doubleCheckValidation() {
151
159
  // Disable the fast personal details if the form is invalidated by other components running AFTER
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4site/engrid-scripts",
3
- "version": "0.22.1",
3
+ "version": "0.22.3",
4
4
  "description": "Scripts for the ENGRID Project",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "strongly-typed-events": "^2.0.9"
26
26
  },
27
27
  "homepage": "https://github.com/4site-interactive-studios/engrid#readme",
28
- "gitHead": "831fa83063d0b6b961ae9ebae68e5f31c15be7b9",
28
+ "gitHead": "46a09414790ab639952e5f02c63dd8438629d078",
29
29
  "devDependencies": {
30
30
  "nodemon": "^2.0.20"
31
31
  }