diff --git a/resources/js/components/field-conditions/Validator.js b/resources/js/components/field-conditions/Validator.js index 7850dec8ef8..ce839ea1130 100644 --- a/resources/js/components/field-conditions/Validator.js +++ b/resources/js/components/field-conditions/Validator.js @@ -294,6 +294,6 @@ export default class { return false; } - return intersection(this.getCheckedFieldPaths(dottedPrefix), revealerFields).length; + return intersection(this.getCheckedFieldPaths(dottedPrefix), revealerFields).length > 0; } } diff --git a/resources/js/components/field-conditions/ValidatorMixin.js b/resources/js/components/field-conditions/ValidatorMixin.js index 29170978883..a9f6db7a570 100644 --- a/resources/js/components/field-conditions/ValidatorMixin.js +++ b/resources/js/components/field-conditions/ValidatorMixin.js @@ -15,12 +15,18 @@ export default { let validator = new Validator(field, this.values, this.$store, this.storeName); let passes = validator.passesConditions(); - let hiddenByRevealerField = validator.hasRevealerCondition(dottedPrefix); - this.$store.commit(`publish/${this.storeName}/setHiddenField`, { - dottedKey: dottedKey || field.handle, - hidden: ! passes, - omitValue: ! hiddenByRevealerField, + // TODO: The next tick here is necessary to fix #6018, but not sure it's the _right_ fix. + // Something is loading differently, causing the below `hiddenByRevealerField` check + // to fail, when the replicator is configured to collapse all sets by default 🤔 + this.$nextTick(() => { + let hiddenByRevealerField = validator.hasRevealerCondition(dottedPrefix); + + this.$store.commit(`publish/${this.storeName}/setHiddenField`, { + dottedKey: dottedKey || field.handle, + hidden: ! passes, + omitValue: ! hiddenByRevealerField, + }); }); return passes;