Skip to content

Commit

Permalink
Fixing inner conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jan 29, 2025
1 parent 925a702 commit 89ab403
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [5.9.8]

### Fixed

- Conditional tags inner logic.

## [5.9.7]

### Fixed
Expand Down Expand Up @@ -1029,6 +1035,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a

- Initial production release.

[5.9.8]: https://github.com/infinum/eightshift-forms/compare/5.9.7...5.9.8
[5.9.7]: https://github.com/infinum/eightshift-forms/compare/5.9.6...5.9.7
[5.9.6]: https://github.com/infinum/eightshift-forms/compare/5.9.5...5.9.6
[5.9.5]: https://github.com/infinum/eightshift-forms/compare/5.9.4...5.9.5
Expand Down
2 changes: 1 addition & 1 deletion eightshift-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level.
* Author: WordPress team @Infinum
* Author URI: https://eightshift.com/
* Version: 5.9.7
* Version: 5.9.8
* Text Domain: eightshift-forms
*
* @package EightshiftForms
Expand Down
16 changes: 16 additions & 0 deletions src/Blocks/components/form/assets/conditional-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,22 @@ export class ConditionalTags {
value = this.state.getStateElementValue(innerName, formId)[innerValue] === innerValue ? innerValue : '';
}
break;
case 'select':
case 'country':
value = this.state.getStateElementValue(innerName, formId).map((item) => item?.value);

if (value.length === 0) {
value = '';
}

if (innerCondition === this.IS) {
innerCondition = this.C;
}

if (innerCondition === this.ISN) {
innerCondition = this.CN;
}
break;
default:
// Get element value by name.
value = this.state.getStateElementValue(innerName, formId);
Expand Down

0 comments on commit 89ab403

Please sign in to comment.