Skip to content

Commit 600d800

Browse files
committed
Fixed issue where form component subforms was loading when conditions did not apply.
1 parent a8429bc commit 600d800

13 files changed

+22
-12
lines changed

Changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 2.29.5
8+
### Fixed
9+
- Ensure that the form components do not load if conditions on the component return false.
10+
711
## 2.29.4
812
### Added
913
- More input hooks to certain components.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "formiojs",
33
"description": "Common js library for client side interaction with <form.io>",
4-
"version": "2.29.4",
4+
"version": "2.29.5",
55
"main": "dist/formio.min.js",
66
"license": "MIT",
77
"homepage": "https://github.com/formio/formio.js",

dist/formio.embed.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7407,7 +7407,8 @@ var FormComponent = exports.FormComponent = function (_FormioForm) {
74077407
_createClass(FormComponent, [{
74087408
key: 'loadSubForm',
74097409
value: function loadSubForm() {
7410-
if (this.subFormLoaded) {
7410+
// Only load the subform if the subform isn't loaded and the conditions apply.
7411+
if (this.subFormLoaded || !_get(FormComponent.prototype.__proto__ || Object.getPrototypeOf(FormComponent.prototype), 'checkConditions', this).call(this, this.root ? this.root.data : this.data)) {
74117412
return true;
74127413
}
74137414
this.subFormLoaded = true;

dist/formio.embed.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formio.form.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7407,7 +7407,8 @@ var FormComponent = exports.FormComponent = function (_FormioForm) {
74077407
_createClass(FormComponent, [{
74087408
key: 'loadSubForm',
74097409
value: function loadSubForm() {
7410-
if (this.subFormLoaded) {
7410+
// Only load the subform if the subform isn't loaded and the conditions apply.
7411+
if (this.subFormLoaded || !_get(FormComponent.prototype.__proto__ || Object.getPrototypeOf(FormComponent.prototype), 'checkConditions', this).call(this, this.root ? this.root.data : this.data)) {
74117412
return true;
74127413
}
74137414
this.subFormLoaded = true;

dist/formio.form.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formio.full.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7407,7 +7407,8 @@ var FormComponent = exports.FormComponent = function (_FormioForm) {
74077407
_createClass(FormComponent, [{
74087408
key: 'loadSubForm',
74097409
value: function loadSubForm() {
7410-
if (this.subFormLoaded) {
7410+
// Only load the subform if the subform isn't loaded and the conditions apply.
7411+
if (this.subFormLoaded || !_get(FormComponent.prototype.__proto__ || Object.getPrototypeOf(FormComponent.prototype), 'checkConditions', this).call(this, this.root ? this.root.data : this.data)) {
74117412
return true;
74127413
}
74137414
this.subFormLoaded = true;

dist/formio.full.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formio.wizard.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7407,7 +7407,8 @@ var FormComponent = exports.FormComponent = function (_FormioForm) {
74077407
_createClass(FormComponent, [{
74087408
key: 'loadSubForm',
74097409
value: function loadSubForm() {
7410-
if (this.subFormLoaded) {
7410+
// Only load the subform if the subform isn't loaded and the conditions apply.
7411+
if (this.subFormLoaded || !_get(FormComponent.prototype.__proto__ || Object.getPrototypeOf(FormComponent.prototype), 'checkConditions', this).call(this, this.root ? this.root.data : this.data)) {
74117412
return true;
74127413
}
74137414
this.subFormLoaded = true;

dist/formio.wizard.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/components/form/Form.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ var FormComponent = exports.FormComponent = function (_FormioForm) {
6363
_createClass(FormComponent, [{
6464
key: 'loadSubForm',
6565
value: function loadSubForm() {
66-
if (this.subFormLoaded) {
66+
// Only load the subform if the subform isn't loaded and the conditions apply.
67+
if (this.subFormLoaded || !_get(FormComponent.prototype.__proto__ || Object.getPrototypeOf(FormComponent.prototype), 'checkConditions', this).call(this, this.root ? this.root.data : this.data)) {
6768
return true;
6869
}
6970
this.subFormLoaded = true;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "formiojs",
3-
"version": "2.29.4",
3+
"version": "2.29.5",
44
"description": "Common js library for client side interaction with <form.io>",
55
"main": "lib/index.js",
66
"files": [

src/components/form/Form.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export class FormComponent extends FormioForm {
2424
* Load the subform.
2525
*/
2626
loadSubForm() {
27-
if (this.subFormLoaded) {
27+
// Only load the subform if the subform isn't loaded and the conditions apply.
28+
if (this.subFormLoaded || !super.checkConditions(this.root ? this.root.data : this.data)) {
2829
return true;
2930
}
3031
this.subFormLoaded = true;

0 commit comments

Comments
 (0)