nova-flexible-content icon indicating copy to clipboard operation
nova-flexible-content copied to clipboard

Conditional Rendering fields not working

Open felixmFlow opened this issue 1 year ago • 4 comments

Hello, I have a scenario where i'm adding a conditional field in the layout but for some reason, it's not working.

Flexible::make('custom', 'custom') ->addLayout('', 'wysiwyg', [ Select::make(__('Type'), 'type') ->options([ 'opt1' => 'opt1', 'opt2' => 'opt2' ]),

                        KeyValue::make(__('Options'), 'option')
                            ->if(['type'], fn($value) => $value['type'] === 'opt1'),
                        ]),
           ])
           
           The keyValue field always show up and when the select dropdown changes nothing happens to the keyValue field.
           
       

felixmFlow avatar Mar 10 '23 17:03 felixmFlow