From b7aa14bdd76f49a57584ed69c34998cbdcf67323 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Wed, 4 Mar 2020 17:42:35 +0200 Subject: [PATCH] fix: guessInitialState() state name 'hidden' does not exists Visibility setting 'Hidden' in webform UI is actually named 'invisible' in the code. Previous state name 'hidden' does not exist. Example 'Hidden' state YAML: ``` name: '#type': textfield '#title': Name '#required': true '#states': invisible: ':input[name="show_textfield"]': unchecked: true ``` --- src/utils.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.tsx b/src/utils.tsx index e4289ab..941d3ce 100644 --- a/src/utils.tsx +++ b/src/utils.tsx @@ -52,7 +52,7 @@ function checkConditions(element: Element, conditions: State['condition']): bool * reduce flickering and elements jumping around. * * Guesses: - * - If hidden|visible states are present assume they are used to initally hide. + * - If invisible|visible states are present assume they are used to initally hide. * * @param states */ @@ -61,7 +61,7 @@ function guessInitialState(states: State[]) { for (const state of states) { switch (state.state) { - case 'hidden': + case 'invisible': initialState[state.state] = true case 'visible': default: