nova-flexible-content
nova-flexible-content copied to clipboard
Conditional Rendering fields not working
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.