-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Labels
Description
Hi, in the docs it is mentioned to add the css class fb-cl-hide-element, to make conditional logic work. It seems formbuilder is using this class to set the initial visibility of certain fields, that should be hidden by conditional logic.
| - Add the `fb-cl-hide-element` class with a `display:none;` property to your project style |
Lines 25 to 27 in d268b50
| foreach ($this->getFields() as $conditionFieldName) { | |
| $data[$conditionFieldName] = $state === $toggleState ? 'fb-cl-hide-element' : ''; | |
| } |
So when setting up a condition like this:
The fb-cl-hide-element is added to the required form field as expected but then, it never gets removed. Since the "Toggle Visibility" feature in general works by adding inline style style="display:none" in the DOM.
So users now have two options:
- Don't add the class
fb-cl-hide-elementto the project styles, then "Toggle Visibility" feature will work - Use "Toggle Class" in combination with
fb-cl-hide-elementto hide form fields
Is it just me or are the docs a bit misleading on this topic?
Thanks for feedback in advance!
Reactions are currently unavailable

