conditional-field icon indicating copy to clipboard operation
conditional-field copied to clipboard

Multiple keys for visibility of the same element

Open Stacyy opened this issue 8 years ago • 2 comments

This is allow defining multiple inputs which control the visibility for the same element. @stevenwanderski please review the code.

Stacyy avatar Dec 07 '17 16:12 Stacyy

Hi @Stacyy,

First of all, thanks for your work!

I have reviewed your code. It works OK in the situation that there is only one element in the visilibity string.

In the following case, the code does not handle the situation correctly:

new ConditionalField({
            control: 'input[name="control_input"]',
            visibility: {
              'answer1': '.element-specific-for-answer-1, .element-common-for-answer1-and-2',
              'answer2': '.element-specific-for-answer-2, .element-common-for-answer1-and-2'    
            }
          });

carlosreig avatar Dec 23 '17 16:12 carlosreig

Hi @carlosreig - thanks for the review.

I commissioned @Stacyy to add this feature, she's not currently working on my project for me to commission her to make the update so it may be a while until this gets updated (unless @Stacyy wants to fix this in her free time? 😝 )

lougreenwood avatar Jan 14 '18 10:01 lougreenwood