11import {
2- ConditionsScope ,
32 ProcessorFn ,
43 ProcessorFnSync ,
54 ProcessorInfo ,
@@ -93,7 +92,10 @@ export function isForcedHidden(
9392 isConditionallyHidden : ConditionallyHidden ,
9493) : boolean {
9594 const { component } = context ;
96- if ( isConditionallyHidden ( context as ConditionsContext ) ) {
95+ if (
96+ component . ephemeralState ?. conditionallyHidden ||
97+ isConditionallyHidden ( context as ConditionsContext )
98+ ) {
9799 return true ;
98100 }
99101 if ( component . hasOwnProperty ( 'hidden' ) ) {
@@ -106,20 +108,8 @@ export const _shouldSkipValidation = (
106108 context : ValidationContext ,
107109 isConditionallyHidden : ConditionallyHidden ,
108110) => {
109- const { component, scope, path } = context ;
110- const absolutePath = getComponentAbsolutePath ( component ) || path ;
111+ const { component } = context ;
111112
112- if (
113- ( scope as ConditionsScope ) ?. conditionals &&
114- ( find ( ( scope as ConditionsScope ) . conditionals , {
115- path : absolutePath ,
116- conditionallyHidden : true ,
117- } ) ||
118- component . ephemeralState ?. conditionallyHidden === true )
119- ) {
120- return true ;
121- }
122- const { validateWhenHidden = false } = component || { } ;
123113 const rules = [
124114 // Skip validation if component is readOnly
125115 // () => this.options.readOnly,
@@ -128,7 +118,7 @@ export const _shouldSkipValidation = (
128118 // Check to see if we are editing and if so, check component persistence.
129119 ( ) => isValueHidden ( context ) ,
130120 // Force valid if component is hidden.
131- ( ) => isForcedHidden ( context , isConditionallyHidden ) && ! validateWhenHidden ,
121+ ( ) => ! component . validateWhenHidden && isForcedHidden ( context , isConditionallyHidden ) ,
132122 ] ;
133123
134124 return rules . some ( ( pred ) => pred ( ) ) ;
0 commit comments