Skip to content

Commit

Permalink
chore: remove conditionChecker leafNodeDeletion param
Browse files Browse the repository at this point in the history
Related to #1142
  • Loading branch information
Skaiir committed Apr 10, 2024
1 parent 2d11a07 commit 72eb29c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export class ConditionChecker {
const workingData = clone(data);

const {
getFilterPath = (field, indexes) => this._pathRegistry.getValuePath(field, { indexes }),
leafNodeDeletionOnly = false
getFilterPath = (field, indexes) => this._pathRegistry.getValuePath(field, { indexes })
} = options;

const _applyConditionsWithinScope = (rootField, scopeContext, startHidden = false) => {
Expand Down Expand Up @@ -60,7 +59,7 @@ export class ConditionChecker {
context.isHidden = startHidden || context.isHidden || (conditional && this._checkHideCondition(conditional, localExpressionContext));

// if a field is repeatable and visible, we need to implement custom recursion on its children
if (isRepeatable && (!context.isHidden || leafNodeDeletionOnly)) {
if (isRepeatable && (!context.isHidden)) {

// prevent the regular recursion behavior of executeRecursivelyOnFields
context.preventRecursion = true;
Expand Down Expand Up @@ -93,7 +92,7 @@ export class ConditionChecker {
}

// if we have a hidden repeatable field, and the data structure allows, we clear it directly at the root and stop recursion
if (context.isHidden && !leafNodeDeletionOnly && isRepeatable) {
if (context.isHidden && isRepeatable) {
context.preventRecursion = true;
this._cleanlyClearDataAtPath(getFilterPath(field, indexes), workingData);
}
Expand Down

0 comments on commit 72eb29c

Please sign in to comment.